From 994c9ede5c4b0e7555f63006b51401db7a1fe578 Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Tue, 1 Aug 2023 15:37:58 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Remove=20and=20move=20some?= =?UTF-8?q?=20more=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Config/ConfigChanger.tsx | 99 ---------------- src/components/Config/LoadConfig.tsx | 106 ------------------ .../User/Create}/create-account-step.tsx | 0 .../User/Create}/security-step.tsx | 0 .../Preferences}/Language/LanguageSelect.tsx | 0 .../SearchEngine/SearchEngineSelector.tsx | 0 .../SearchEngine/SearchNewTabSwitch.tsx | 0 .../{BoardHead.tsx => BoardHeadOverride.tsx} | 0 .../layout/Templates/BoardLayout.tsx | 2 +- src/pages/manage/users/create.tsx | 4 +- 10 files changed, 3 insertions(+), 208 deletions(-) delete mode 100644 src/components/Config/ConfigChanger.tsx delete mode 100644 src/components/Config/LoadConfig.tsx rename src/components/{Admin/CreateNewUser => Manage/User/Create}/create-account-step.tsx (100%) rename src/components/{Admin/CreateNewUser => Manage/User/Create}/security-step.tsx (100%) rename src/components/{Settings/Common => User/Preferences}/Language/LanguageSelect.tsx (100%) rename src/components/{Settings/Common => User/Preferences}/SearchEngine/SearchEngineSelector.tsx (100%) rename src/components/{Settings/Common => User/Preferences}/SearchEngine/SearchNewTabSwitch.tsx (100%) rename src/components/layout/Meta/{BoardHead.tsx => BoardHeadOverride.tsx} (100%) diff --git a/src/components/Config/ConfigChanger.tsx b/src/components/Config/ConfigChanger.tsx deleted file mode 100644 index 8613660ae..000000000 --- a/src/components/Config/ConfigChanger.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import { Center, Dialog, Loader, Notification, Select, Tooltip } from '@mantine/core'; -import { useToggle } from '@mantine/hooks'; -import { notifications } from '@mantine/notifications'; -import { IconCheck } from '@tabler/icons-react'; -import { setCookie } from 'cookies-next'; -import { useTranslation } from 'next-i18next'; -import { useRouter } from 'next/router'; -import { useState } from 'react'; -import { api } from '~/utils/api'; - -import { useConfigContext } from '../../config/provider'; - -export default function ConfigChanger() { - const router = useRouter(); - - const { t } = useTranslation('settings/general/config-changer'); - const { name: configName, setConfigName } = useConfigContext(); - - const { data: configs, isLoading } = useConfigsQuery(); - const [activeConfig, setActiveConfig] = useState(configName); - const [isRefreshing, toggle] = useToggle(); - - const onConfigChange = (value: string) => { - setCookie('config-name', value ?? 'default', { - maxAge: 60 * 60 * 24 * 30, - sameSite: 'strict', - }); - setActiveConfig(value); - - notifications.show({ - id: 'load-data', - loading: true, - title: t('configSelect.loadingNew'), - radius: 'md', - withCloseButton: false, - message: t('configSelect.pleaseWait'), - autoClose: false, - }); - - setTimeout(() => { - notifications.update({ - id: 'load-data', - color: 'teal', - radius: 'md', - withCloseButton: false, - title: t('configSelect.loadingNew'), - message: t('configSelect.pleaseWait'), - icon: , - autoClose: 2000, - }); - }, 3000); - setTimeout(() => { - router.push(`/${value}`); - setConfigName(value); - }, 500); - }; - - // If configlist is empty, return a loading indicator - if (isLoading || !configs || configs.length === 0 || !configName) { - return ( - -
- -
-
- ); - } - - return ( - <> -