🔥 Remove old and unused components

This commit is contained in:
Manuel Ruwe
2022-12-23 17:17:57 +01:00
parent b23f464140
commit f3b601dc2d
37 changed files with 131 additions and 1945 deletions

View File

@@ -1,15 +1,14 @@
import { Group, Text, useMantineTheme } from '@mantine/core';
import { IconX as X, IconCheck as Check, IconX, IconPhoto, IconUpload } from '@tabler/icons';
import { showNotification } from '@mantine/notifications';
import { setCookie } from 'cookies-next';
import { Dropzone } from '@mantine/dropzone';
import { showNotification } from '@mantine/notifications';
import { IconCheck as Check, IconPhoto, IconUpload, IconX, IconX as X } from '@tabler/icons';
import { setCookie } from 'cookies-next';
import { useTranslation } from 'next-i18next';
import { useConfig } from '../../tools/state';
import { useConfigStore } from '../../config/store';
import { Config } from '../../tools/types';
import { migrateToIdConfig } from '../../tools/migrate';
export default function LoadConfigComponent(props: any) {
const { setConfig } = useConfig();
const { updateConfig } = useConfigStore();
const theme = useMantineTheme();
const { t } = useTranslation('settings/general/config-changer');
@@ -48,8 +47,7 @@ export default function LoadConfigComponent(props: any) {
maxAge: 60 * 60 * 24 * 30,
sameSite: 'strict',
});
const migratedConfig = migrateToIdConfig(newConfig);
setConfig(migratedConfig);
updateConfig(newConfig.name, (previousConfig) => ({ ...previousConfig, newConfig }));
});
}}
accept={['application/json']}

View File

@@ -1,3 +1,4 @@
/* eslint-disable react/no-unknown-property */
import { ReactNode, RefObject } from 'react';
interface GridstackTileWrapperProps {

View File

@@ -6,10 +6,10 @@ import { useConfigContext } from '../../../../config/provider';
import { useConfigStore } from '../../../../config/store';
import { CategoryType } from '../../../../types/category';
export interface CategoryEditModalInnerProps {
export type CategoryEditModalInnerProps = {
category: CategoryType;
onSuccess: (category: CategoryType) => Promise<void>;
}
};
export const CategoryEditModal = ({
context,

View File

@@ -25,6 +25,7 @@ export const DashboardSidebar = ({ location }: DashboardSidebarProps) => {
className="grid-stack grid-stack-sidebar"
style={{ transitionDuration: '0s', height: '100%' }}
data-sidebar={location}
// eslint-disable-next-line react/no-unknown-property
gs-min-row={minRow}
ref={refs.wrapper}
>

View File

@@ -1,36 +0,0 @@
import { Aside as MantineAside, createStyles } from '@mantine/core';
import Widgets from './Widgets';
const useStyles = createStyles((theme) => ({
hide: {
[theme.fn.smallerThan('xs')]: {
display: 'none',
},
},
burger: {
[theme.fn.largerThan('sm')]: {
display: 'none',
},
},
}));
export default function Aside(props: any) {
const { classes, cx } = useStyles();
return (
<MantineAside
pr="md"
hiddenBreakpoint="sm"
hidden
className={cx(classes.hide)}
style={{
border: 'none',
background: 'none',
}}
width={{
base: 'auto',
}}
>
<Widgets />
</MantineAside>
);
}

View File

@@ -1,37 +0,0 @@
import { createStyles, Navbar as MantineNavbar } from '@mantine/core';
import Widgets from './Widgets';
const useStyles = createStyles((theme) => ({
hide: {
[theme.fn.smallerThan('xs')]: {
display: 'none',
},
},
burger: {
[theme.fn.largerThan('sm')]: {
display: 'none',
},
},
}));
export default function Navbar() {
const { classes, cx } = useStyles();
return (
<MantineNavbar
pl="md"
hiddenBreakpoint="sm"
hidden
className={cx(classes.hide)}
style={{
border: 'none',
background: 'none',
}}
width={{
base: 'auto',
}}
>
<Widgets />
</MantineNavbar>
);
}

View File

@@ -1,16 +0,0 @@
import { Stack } from '@mantine/core';
import { CalendarModule, DateModule, TotalDownloadsModule, WeatherModule } from '../../modules';
import { DashdotModule } from '../../modules/dashdot';
import { ModuleWrapper } from '../../modules/moduleWrapper';
export default function Widgets(props: any) {
return (
<Stack my={16} style={{ width: 300 }}>
<ModuleWrapper module={CalendarModule} />
<ModuleWrapper module={TotalDownloadsModule} />
<ModuleWrapper module={WeatherModule} />
<ModuleWrapper module={DateModule} />
<ModuleWrapper module={DashdotModule} />
</Stack>
);
}

View File

@@ -58,7 +58,9 @@ export function Search() {
// TODO: ask manuel-rw about overseerr
// Answer: We can simply check if there is a app of the type overseer and display results if there is one.
// Overseerr is not use anywhere else, so it makes no sense to add a standalone toggle for displaying results
const isOverseerrEnabled = false; //config?.settings.common.enabledModules.overseerr;
const isOverseerrEnabled = config?.apps.some(
(x) => x.integration.type === 'overseerr' || x.integration.type === 'jellyseerr'
);
const overseerrApp = config?.apps.find(
(app) => app.integration?.type === 'overseerr' || app.integration?.type === 'jellyseerr'
);