diff --git a/src/components/Config/LoadConfig.tsx b/src/components/Config/LoadConfig.tsx index f29d65a75..09fc1a09f 100644 --- a/src/components/Config/LoadConfig.tsx +++ b/src/components/Config/LoadConfig.tsx @@ -5,61 +5,20 @@ import { IconX as X, IconCheck as Check, TablerIcon, + IconX, + IconPhoto, + IconUpload, } from '@tabler/icons'; import { showNotification } from '@mantine/notifications'; -import { useRef } from 'react'; -import { useRouter } from 'next/router'; import { setCookie } from 'cookies-next'; import { Dropzone } from '@mantine/dropzone'; import { useConfig } from '../../tools/state'; import { Config } from '../../tools/types'; import { migrateToIdConfig } from '../../tools/migrate'; -function getIconColor(status: DropzoneStatus, theme: MantineTheme) { - return status.accepted - ? theme.colors[theme.primaryColor][theme.colorScheme === 'dark' ? 4 : 6] - : status.rejected - ? theme.colors.red[theme.colorScheme === 'dark' ? 4 : 6] - : theme.colorScheme === 'dark' - ? theme.colors.dark[0] - : theme.colors.gray[7]; -} - -function ImageUploadIcon({ - status, - ...props -}: React.ComponentProps & { status: DropzoneStatus }) { - if (status.accepted) { - return ; - } - - if (status.rejected) { - return ; - } - - return ; -} - -export const dropzoneChildren = (status: DropzoneStatus, theme: MantineTheme) => ( - - - -
- - Drag images here or click to select files - - - Attach as many files as you like, each file should not exceed 5mb - -
-
-); - export default function LoadConfigComponent(props: any) { const { setConfig } = useConfig(); const theme = useMantineTheme(); - const router = useRouter(); - const openRef = useRef<() => void>(); return ( - {(status: any) => dropzoneChildren(status, theme)} + + + + + Drag files here to upload a config. Support for JSON only. + + + + + + This file format is not supported. Please only upload JSON. + + + + + + ); }