Skip to content

Commit

Permalink
refactor: optimize imports (#1822)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rw authored Jan 15, 2024
1 parent c701f72 commit 5bae5bf
Show file tree
Hide file tree
Showing 33 changed files with 49 additions and 196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const WidgetElementType = ({ id, image, disabled, widget }: WidgetElement
const getLowestWrapper = () => config?.wrappers.sort((a, b) => a.position - b.position)[0];

const handleAddition = async () => {
updateConfig(
await updateConfig(
configName,
(prev) => ({
...prev,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const CategoryEditModal = ({
});

const handleSubmit = async (values: FormType) => {
innerProps.onSuccess({ ...innerProps.category, name: values.name });
await innerProps.onSuccess({ ...innerProps.category, name: values.name });
context.closeModal(id);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const useCategoryActions = (configName: string | undefined, category: Cat
};

// Adding category and wrapper and moving other items down
updateConfig(
await updateConfig(
configName,
(previous) => {
const aboveWrappers = previous.wrappers.filter((x) => x.position <= abovePosition);
Expand Down Expand Up @@ -87,7 +87,7 @@ export const useCategoryActions = (configName: string | undefined, category: Cat
};

// Adding category and wrapper and moving other items down
updateConfig(
await updateConfig(
configName,
(previous) => {
const aboveWrappers = previous.wrappers.filter((x) => x.position < belowPosition);
Expand Down
2 changes: 1 addition & 1 deletion src/config/provider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode, createContext, useContext, useEffect, useState } from 'react';
import { createContext, ReactNode, useContext, useEffect, useState } from 'react';
import { shallow } from 'zustand/shallow';
import { useColorTheme } from '~/tools/color';
import { ConfigType } from '~/types/config';
Expand Down
2 changes: 1 addition & 1 deletion src/images/undraw_bug_fixing_oc-7-a.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/images/undraw_page_not_found_re_e9o6.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/images/undraw_secure_login_pdn4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 0 additions & 30 deletions src/modules/ModuleTypes.ts

This file was deleted.

18 changes: 9 additions & 9 deletions src/pages/401.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Button, Center, Stack, Title, Text, createStyles } from "@mantine/core";
import { useTranslation } from "next-i18next";
import Image from "next/image";
import Head from "next/head";
import { MainLayout } from "~/components/layout/Templates/MainLayout";
import Link from "next/link";
import { Button, Center, createStyles, Stack, Text, Title } from '@mantine/core';
import { useTranslation } from 'next-i18next';
import Image from 'next/image';
import Head from 'next/head';
import { MainLayout } from '~/components/layout/Templates/MainLayout';
import Link from 'next/link';

import imageAccessDenied from '~/images/undraw_secure_login_pdn4.svg';
import { pageAccessDeniedNamespaces } from "~/tools/server/translation-namespaces";
import { getServerSideTranslations } from "~/tools/server/getServerSideTranslations";
import { GetServerSidePropsContext } from "next";
import { pageAccessDeniedNamespaces } from '~/tools/server/translation-namespaces';
import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations';
import { GetServerSidePropsContext } from 'next';

export default function Custom401() {
const { classes } = useStyles();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Center, Stack, Text, Title, createStyles } from '@mantine/core';
import { Button, Center, createStyles, Stack, Text, Title } from '@mantine/core';
import { GetServerSidePropsContext } from 'next';
import { useTranslation } from 'next-i18next';
import Head from 'next/head';
Expand Down
7 changes: 2 additions & 5 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import utc from 'dayjs/plugin/utc';
import 'flag-icons/css/flag-icons.min.css';
import { GetServerSidePropsContext } from 'next';
import { Session } from 'next-auth';
import { SessionProvider, getSession } from 'next-auth/react';
import { getSession, SessionProvider } from 'next-auth/react';
import { appWithTranslation } from 'next-i18next';
import { AppProps } from 'next/app';
import Script from 'next/script';
Expand All @@ -24,10 +24,7 @@ import { modals } from '~/modals';
import { usePackageAttributesStore } from '~/tools/client/zustands/usePackageAttributesStore';
import { ColorTheme } from '~/tools/color';
import { getLanguageByCode } from '~/tools/language';
import {
ServerSidePackageAttributesType,
getServiceSidePackageAttributes,
} from '~/tools/server/getPackageVersion';
import { getServiceSidePackageAttributes, ServerSidePackageAttributesType } from '~/tools/server/getPackageVersion';
import { theme } from '~/tools/server/theme/theme';
import { ConfigType } from '~/types/config';
import { api } from '~/utils/api';
Expand Down
11 changes: 1 addition & 10 deletions src/pages/_error.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import {
Accordion,
Center,
Group,
Stack,
Text,
Title,
createStyles,
useMantineTheme,
} from '@mantine/core';
import { Accordion, Center, createStyles, Group, Stack, Text, Title, useMantineTheme } from '@mantine/core';
import { IconDeviceDesktop, IconInfoCircle, IconServer } from '@tabler/icons-react';
import { NextPageContext } from 'next';
import Head from 'next/head';
Expand Down
12 changes: 1 addition & 11 deletions src/pages/auth/invite/[inviteId].tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import {
Button,
Card,
Flex,
PasswordInput,
Popover,
Stack,
Text,
TextInput,
Title,
} from '@mantine/core';
import { Button, Card, Flex, PasswordInput, Stack, Text, TextInput, Title } from '@mantine/core';
import { useForm } from '@mantine/form';
import { showNotification, updateNotification } from '@mantine/notifications';
import { IconCheck, IconX } from '@tabler/icons-react';
Expand Down
13 changes: 1 addition & 12 deletions src/pages/auth/login.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
import {
ActionIcon,
Alert,
Button,
Card,
Flex,
PasswordInput,
Stack,
Text,
TextInput,
Title,
} from '@mantine/core';
import { Alert, Button, Card, Flex, PasswordInput, Stack, Text, TextInput, Title } from '@mantine/core';
import { useForm } from '@mantine/form';
import { IconAlertTriangle } from '@tabler/icons-react';
import { GetServerSideProps, InferGetServerSidePropsType } from 'next';
Expand Down
Loading

0 comments on commit 5bae5bf

Please sign in to comment.