From a402227c4f65b15646701aba96c8197ff29324b0 Mon Sep 17 00:00:00 2001 From: diced Date: Sun, 27 Nov 2022 19:55:14 -0800 Subject: [PATCH] fix: custom placeholder --- src/components/File.tsx | 4 +- src/components/Type.tsx | 43 ++++++++++++------- .../pages/Dashboard/RecentFiles.tsx | 3 +- src/components/pages/Files/FilePagation.tsx | 1 - src/components/pages/Files/index.tsx | 1 - 5 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/components/File.tsx b/src/components/File.tsx index 7cef4b4..10e17fc 100644 --- a/src/components/File.tsx +++ b/src/components/File.tsx @@ -43,14 +43,12 @@ export function FileMeta({ Icon, title, subtitle, ...other }) { ); } -export default function File({ image, updateImages, disableMediaPreview, exifEnabled }) { +export default function File({ image, disableMediaPreview, exifEnabled }) { const [open, setOpen] = useState(false); const deleteFile = useFileDelete(); const favoriteFile = useFileFavorite(); const clipboard = useClipboard(); - console.log(exifEnabled); - const loading = deleteFile.isLoading || favoriteFile.isLoading; const handleDelete = async () => { diff --git a/src/components/Type.tsx b/src/components/Type.tsx index 200cd1b..3220a48 100644 --- a/src/components/Type.tsx +++ b/src/components/Type.tsx @@ -1,23 +1,26 @@ -import { Group, Image, Text } from '@mantine/core'; +import { Box, Center, Group, Image, Text } from '@mantine/core'; import { Prism } from '@mantine/prism'; import { useEffect, useState } from 'react'; -import { AudioIcon, FileIcon, PlayIcon } from './icons'; +import { AudioIcon, FileIcon, ImageIcon, PlayIcon } from './icons'; + +function PlaceholderContent({ text, Icon }) { + return ( + ({ color: t.colors.dark[2] })}> + + {text} + + ); +} function Placeholder({ text, Icon, ...props }) { if (props.disableResolve) props.src = null; return ( - - - {text} - - } - {...props} - /> + +
+ +
+
); } @@ -50,7 +53,12 @@ export default function Type({ file, popup = false, disableMediaPreview, ...prop media ? ( { video: