mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 16:04:23 +00:00
Migrate ContentView
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Text, Center } from '@mantine/core';
|
||||||
import Editor from './Editor';
|
import Editor from './Editor';
|
||||||
import MarkdownPreview from './MarkdownPreview';
|
import MarkdownPreview from './MarkdownPreview';
|
||||||
import { Text } from '@geist-ui/core';
|
|
||||||
import { getFileUrl } from '../services/api';
|
import { getFileUrl } from '../services/api';
|
||||||
import { isImageFile } from '../utils/fileHelpers';
|
import { isImageFile } from '../utils/fileHelpers';
|
||||||
|
|
||||||
@@ -15,22 +15,17 @@ const ContentView = ({
|
|||||||
}) => {
|
}) => {
|
||||||
if (!selectedFile) {
|
if (!selectedFile) {
|
||||||
return (
|
return (
|
||||||
<div
|
<Center style={{ height: '100%' }}>
|
||||||
style={{
|
<Text size="xl" weight={500}>
|
||||||
display: 'flex',
|
No file selected.
|
||||||
justifyContent: 'center',
|
</Text>
|
||||||
alignItems: 'center',
|
</Center>
|
||||||
height: '100%',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Text h3>No file selected.</Text>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isImageFile(selectedFile)) {
|
if (isImageFile(selectedFile)) {
|
||||||
return (
|
return (
|
||||||
<div className="image-preview">
|
<Center className="image-preview">
|
||||||
<img
|
<img
|
||||||
src={getFileUrl(selectedFile)}
|
src={getFileUrl(selectedFile)}
|
||||||
alt={selectedFile}
|
alt={selectedFile}
|
||||||
@@ -40,7 +35,7 @@ const ContentView = ({
|
|||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Center>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user