diff --git a/components/Settings/SettingsMenu.tsx b/components/Settings/SettingsMenu.tsx new file mode 100644 index 000000000..87911dd53 --- /dev/null +++ b/components/Settings/SettingsMenu.tsx @@ -0,0 +1,80 @@ +import { ActionIcon, Group, Modal, Switch, Title, Text, Tooltip } from '@mantine/core'; +import { showNotification } from '@mantine/notifications'; +import { motion } from 'framer-motion'; +import { CSSProperties, useEffect, useState } from 'react'; +import { Mail, Settings, X } from 'tabler-icons-react'; +import { Config, loadConfig } from '../../tools/config'; +import SaveConfigComponent from '../Config/SaveConfig'; + +function SettingsMenu(props: any) { + const [config, setConfig] = useState({ + searchBar: true, + }); + + useEffect(() => { + const config = loadConfig('settings'); + if (config) { + setConfig(config); + } + }, []); + return ( + + { + setConfig({ + ...config, + searchBar: e.target.checked, + }); + localStorage.setItem( + 'settings', + JSON.stringify({ + ...config, + searchBar: e.target.checked, + }) + ); + }} + checked={config.searchBar} + label="Enable search bar" + /> + + + tip: You can upload your config file by dragging and dropping it into the page + + + ); +} + +export function SettingsMenuButton(props: any) { + const [opened, setOpened] = useState(false); + return ( + <> + Settings} + opened={props.opened || opened} + onClose={() => setOpened(false)} + > + + + setOpened(true)} + > + + + + + + ); +}