♻️ Refactor hooks

This commit is contained in:
Manuel Ruwe
2022-12-23 17:29:58 +01:00
parent f3b601dc2d
commit c84d8b59fe
15 changed files with 17 additions and 17 deletions

View File

@@ -2,7 +2,7 @@ import { ActionIcon, createStyles } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import { IconChevronLeft, IconChevronRight } from '@tabler/icons';
import { useConfigContext } from '../../../../config/provider';
import { useScreenLargerThan } from '../../../../tools/hooks/useScreenLargerThan';
import { useScreenLargerThan } from '../../../../hooks/useScreenLargerThan';
import { MobileRibbonSidebarDrawer } from './MobileRibbonSidebarDrawer';
export const MobileRibbons = () => {

View File

@@ -18,10 +18,10 @@ import { useDebouncedValue } from '@mantine/hooks';
import { IconSearch, IconX } from '@tabler/icons';
import { useEffect, useState } from 'react';
import { ICON_PICKER_SLICE_LIMIT } from '../../../../../../../../data/constants';
import { useRepositoryIconsQuery } from '../../../../../../../tools/hooks/useRepositoryIconsQuery';
import { IconSelectorItem } from '../../../../../../../types/iconSelector/iconSelectorItem';
import { WalkxcodeRepositoryIcon } from '../../../../../../../types/iconSelector/repositories/walkxcodeIconRepository';
import { AppType } from '../../../../../../../types/app';
import { useRepositoryIconsQuery } from '../../../../../../../hooks/useRepositoryIconsQuery';
interface IconSelectorProps {
form: UseFormReturnType<AppType, (values: AppType) => AppType>;

View File

@@ -1,7 +1,7 @@
import { Group, Stack } from '@mantine/core';
import { useMemo } from 'react';
import { useConfigContext } from '../../../config/provider';
import { useScreenSmallerThan } from '../../../tools/hooks/useScreenSmallerThan';
import { useScreenSmallerThan } from '../../../hooks/useScreenSmallerThan';
import { CategoryType } from '../../../types/category';
import { WrapperType } from '../../../types/wrapper';
import { DashboardCategory } from '../Wrappers/Category/Category';

View File

@@ -1,7 +1,7 @@
import { ActionIcon, Button, Text, Tooltip } from '@mantine/core';
import { IconEdit, IconEditOff } from '@tabler/icons';
import { useTranslation } from 'next-i18next';
import { useScreenLargerThan } from '../../../tools/hooks/useScreenLargerThan';
import { useScreenLargerThan } from '../../../hooks/useScreenLargerThan';
import { useEditModeStore } from './useEditModeStore';
export const ViewToggleButton = () => {

View File

@@ -2,7 +2,7 @@ import { ActionIcon, Button, Popover, Text, Tooltip } from '@mantine/core';
import { IconEditCircle, IconEditCircleOff, IconX } from '@tabler/icons';
import { Trans, useTranslation } from 'next-i18next';
import { useState } from 'react';
import { useScreenSmallerThan } from '../../../../../tools/hooks/useScreenSmallerThan';
import { useScreenSmallerThan } from '../../../../../hooks/useScreenSmallerThan';
import { useEditModeStore } from '../../../../Dashboard/Views/useEditModeStore';

View File

@@ -4,15 +4,15 @@ import { Results } from 'sabnzbd-api';
import {
UsenetQueueRequestParams,
UsenetQueueResponse,
} from '../../pages/api/modules/usenet/queue';
} from '../pages/api/modules/usenet/queue';
import {
UsenetHistoryRequestParams,
UsenetHistoryResponse,
} from '../../pages/api/modules/usenet/history';
import { UsenetInfoRequestParams, UsenetInfoResponse } from '../../pages/api/modules/usenet';
import { UsenetPauseRequestParams } from '../../pages/api/modules/usenet/pause';
import { queryClient } from '../queryClient';
import { UsenetResumeRequestParams } from '../../pages/api/modules/usenet/resume';
} from '../pages/api/modules/usenet/history';
import { UsenetInfoRequestParams, UsenetInfoResponse } from '../pages/api/modules/usenet';
import { UsenetPauseRequestParams } from '../pages/api/modules/usenet/pause';
import { queryClient } from '../tools/queryClient';
import { UsenetResumeRequestParams } from '../pages/api/modules/usenet/resume';
const POLLING_INTERVAL = 2000;

View File

@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query';
import { IconSelectorItem } from '../../types/iconSelector/iconSelectorItem';
import { IconSelectorItem } from '../types/iconSelector/iconSelectorItem';
export const useRepositoryIconsQuery = <TRepositoryIcon extends object>({
url,

View File

@@ -2,7 +2,7 @@ import { Center, Stack, Text, Title } from '@mantine/core';
import { IconClock } from '@tabler/icons';
import dayjs from 'dayjs';
import { useEffect, useRef, useState } from 'react';
import { useSetSafeInterval } from '../../tools/hooks/useSetSafeInterval';
import { useSetSafeInterval } from '../../hooks/useSetSafeInterval';
import { defineWidget } from '../helper';
import { IWidget } from '../widgets';

View File

@@ -9,7 +9,7 @@ import axios from 'axios';
import { useTranslation } from 'next-i18next';
import { useEffect, useState } from 'react';
import { useConfigContext } from '../../config/provider';
import { useSetSafeInterval } from '../../tools/hooks/useSetSafeInterval';
import { useSetSafeInterval } from '../../hooks/useSetSafeInterval';
import { humanFileSize } from '../../tools/humanFileSize';
import { defineWidget } from '../helper';
import { IWidget } from '../widgets';

View File

@@ -17,7 +17,7 @@ import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
import { useTranslation } from 'next-i18next';
import { useConfigContext } from '../../config/provider';
import { useGetUsenetInfo, usePauseUsenetQueue, useResumeUsenetQueue } from '../../tools/hooks/api';
import { useGetUsenetInfo, usePauseUsenetQueue, useResumeUsenetQueue } from '../../hooks/api';
import { humanFileSize } from '../../tools/humanFileSize';
import { AppIntegrationType } from '../../types/app';
import { defineWidget } from '../helper';

View File

@@ -18,7 +18,7 @@ import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
import { useTranslation } from 'next-i18next';
import { FunctionComponent, useState } from 'react';
import { useGetUsenetHistory } from '../../tools/hooks/api';
import { useGetUsenetHistory } from '../../hooks/api';
import { humanFileSize } from '../../tools/humanFileSize';
import { parseDuration } from '../../tools/parseDuration';

View File

@@ -21,7 +21,7 @@ import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
import { useTranslation } from 'next-i18next';
import { FunctionComponent, useState } from 'react';
import { useGetUsenetDownloads } from '../../tools/hooks/api';
import { useGetUsenetDownloads } from '../../hooks/api';
import { humanFileSize } from '../../tools/humanFileSize';
dayjs.extend(duration);