Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Upgrade to @tabler/icons-react #914

Merged
merged 1 commit into from May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -42,7 +42,7 @@
"@nivo/core": "^0.80.0",
"@nivo/line": "^0.80.0",
"@react-native-async-storage/async-storage": "^1.18.1",
"@tabler/icons": "^1.106.0",
"@tabler/icons-react": "^2.18.0",
"@tanstack/query-async-storage-persister": "^4.27.1",
"@tanstack/query-sync-storage-persister": "^4.27.1",
"@tanstack/react-query": "^4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Config/LoadConfig.tsx
@@ -1,7 +1,7 @@
import { Group, Stack, Text, Title, useMantineTheme } from '@mantine/core';
import { Dropzone } from '@mantine/dropzone';
import { showNotification } from '@mantine/notifications';
import { IconCheck as Check, IconPhoto, IconUpload, IconX, IconX as X } from '@tabler/icons';
import { IconCheck as Check, IconPhoto, IconUpload, IconX, IconX as X } from '@tabler/icons-react';
import { setCookie } from 'cookies-next';
import { useTranslation } from 'next-i18next';
import { useConfigStore } from '../../config/store';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard/Mobile/Ribbon/MobileRibbon.tsx
@@ -1,6 +1,6 @@
import { ActionIcon, createStyles, Space } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import { IconChevronLeft, IconChevronRight } from '@tabler/icons';
import { IconChevronLeft, IconChevronRight } from '@tabler/icons-react';
import { useConfigContext } from '../../../../config/provider';
import { useScreenLargerThan } from '../../../../hooks/useScreenLargerThan';
import { MobileRibbonSidebarDrawer } from './MobileRibbonSidebarDrawer';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard/Modals/AboutModal/AboutModal.tsx
Expand Up @@ -26,7 +26,7 @@ import {
IconVersions,
IconVocabulary,
IconWorldWww,
} from '@tabler/icons';
} from '@tabler/icons-react';
import { motion } from 'framer-motion';
import { InitOptions } from 'i18next';
import { i18n, Trans, useTranslation } from 'next-i18next';
Expand Down
Expand Up @@ -9,7 +9,7 @@ import {
IconBrush,
IconClick,
IconPlug,
} from '@tabler/icons';
} from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { useState } from 'react';
import { useConfigContext } from '../../../../config/provider';
Expand Down
@@ -1,6 +1,6 @@
import { Tabs, TextInput } from '@mantine/core';
import { UseFormReturnType } from '@mantine/form';
import { IconClick, IconCursorText, IconLink } from '@tabler/icons';
import { IconClick, IconCursorText, IconLink } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { AppType } from '../../../../../../types/app';
import { EditAppModalTab } from '../type';
Expand Down
Expand Up @@ -12,15 +12,15 @@ import {
Badge,
Tooltip,
} from '@mantine/core';
import { TablerIcon } from '@tabler/icons';
import { Icon } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { useState } from 'react';
import { AppIntegrationPropertyAccessabilityType } from '../../../../../../../../types/app';

interface GenericSecretInputProps {
label: string;
value: string;
setIcon: TablerIcon;
setIcon: Icon;
secretIsPresent: boolean;
type: AppIntegrationPropertyAccessabilityType;
onClickUpdateButton: (value: string | undefined) => void;
Expand Down
@@ -1,6 +1,6 @@
import { Stack } from '@mantine/core';
import { UseFormReturnType } from '@mantine/form';
import { IconKey } from '@tabler/icons';
import { IconKey } from '@tabler/icons-react';
import {
IntegrationField,
integrationFieldDefinitions,
Expand Down
@@ -1,6 +1,6 @@
import { Alert, Divider, Tabs, Text } from '@mantine/core';
import { UseFormReturnType } from '@mantine/form';
import { IconAlertTriangle } from '@tabler/icons';
import { IconAlertTriangle } from '@tabler/icons-react';
import { Trans, useTranslation } from 'next-i18next';
import { AppType } from '../../../../../../types/app';
import { IntegrationSelector } from './Components/InputElements/IntegrationSelector';
Expand Down
@@ -1,7 +1,7 @@
import { Group, Space, Stack, Text, UnstyledButton } from '@mantine/core';
import { closeModal } from '@mantine/modals';
import { showNotification } from '@mantine/notifications';
import { IconBox, IconBoxAlignTop, IconStack } from '@tabler/icons';
import { IconBox, IconBoxAlignTop, IconStack } from '@tabler/icons-react';
import { motion } from 'framer-motion';
import { useTranslation } from 'next-i18next';
import { ReactNode } from 'react';
Expand Down
@@ -1,5 +1,5 @@
import { Button, Card, Center, Grid, Stack, Text } from '@mantine/core';
import { TablerIcon } from '@tabler/icons';
import { Icon } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import Image from 'next/image';
import React from 'react';
Expand All @@ -9,7 +9,7 @@ interface GenericAvailableElementTypeProps {
name: string;
handleAddition: () => Promise<void>;
description?: string;
image: string | TablerIcon;
image: string | Icon;
disabled?: boolean;
}

Expand Down
@@ -1,5 +1,5 @@
import { Button, Text } from '@mantine/core';
import { IconArrowNarrowLeft } from '@tabler/icons';
import { IconArrowNarrowLeft } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';

interface SelectorBackArrowProps {
Expand Down
@@ -1,5 +1,5 @@
import { Grid, Text } from '@mantine/core';
import { IconCursorText } from '@tabler/icons';
import { IconCursorText } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { GenericAvailableElementType } from '../Shared/GenericElementType';
import { SelectorBackArrow } from '../Shared/SelectorBackArrow';
Expand Down
@@ -1,6 +1,6 @@
import { useModals } from '@mantine/modals';
import { showNotification } from '@mantine/notifications';
import { IconChecks, TablerIcon } from '@tabler/icons';
import { IconChecks, Icon } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { v4 as uuidv4 } from 'uuid';
import { useConfigContext } from '../../../../../../config/provider';
Expand All @@ -11,7 +11,7 @@ import { GenericAvailableElementType } from '../Shared/GenericElementType';

interface WidgetElementTypeProps {
id: string;
image: string | TablerIcon;
image: string | Icon;
disabled?: boolean;
widget: IWidgetDefinition;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard/Tiles/GenericTileMenu.tsx
@@ -1,5 +1,5 @@
import { ActionIcon, Menu } from '@mantine/core';
import { IconDots, IconLayoutKanban, IconPencil, IconTrash } from '@tabler/icons';
import { IconDots, IconLayoutKanban, IconPencil, IconTrash } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { useEditModeStore } from '../Views/useEditModeStore';

Expand Down
@@ -1,6 +1,6 @@
import { Collapse, Flex, Stack, Text, createStyles } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import { IconChevronDown, IconGripVertical } from '@tabler/icons';
import { IconChevronDown, IconGripVertical } from '@tabler/icons-react';
import { Reorder, useDragControls } from 'framer-motion';
import { FC, useEffect, useRef } from 'react';
import { IDraggableEditableListInputValue } from '../../../../../widgets/widgets';
Expand Down
@@ -1,6 +1,6 @@
import { Collapse, createStyles, Flex, Stack, Text } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import { IconChevronDown, IconGripVertical } from '@tabler/icons';
import { IconChevronDown, IconGripVertical } from '@tabler/icons-react';
import { Reorder, useDragControls } from 'framer-motion';
import { FC, ReactNode, useEffect, useRef } from 'react';
import { IDraggableListInputValue } from '../../../../../widgets/widgets';
Expand Down
Expand Up @@ -15,7 +15,7 @@ import {
Title,
} from '@mantine/core';
import { ContextModalProps } from '@mantine/modals';
import { IconAlertTriangle, IconPlaylistX, IconPlus } from '@tabler/icons';
import { IconAlertTriangle, IconPlaylistX, IconPlus } from '@tabler/icons-react';
import { Trans, useTranslation } from 'next-i18next';
import { FC, useState } from 'react';
import { useConfigContext } from '../../../../config/provider';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard/Views/ViewToggleButton.tsx
@@ -1,5 +1,5 @@
import { ActionIcon, Button, Text, Tooltip } from '@mantine/core';
import { IconEdit, IconEditOff } from '@tabler/icons';
import { IconEdit, IconEditOff } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { useScreenLargerThan } from '../../../hooks/useScreenLargerThan';
import { useEditModeStore } from './useEditModeStore';
Expand Down
Expand Up @@ -7,7 +7,7 @@ import {
IconRowInsertBottom,
IconEdit,
IconTrash,
} from '@tabler/icons';
} from '@tabler/icons-react';
import { useConfigContext } from '../../../../config/provider';
import { CategoryType } from '../../../../types/category';
import { useCategoryActions } from './useCategoryActions';
Expand Down
2 changes: 1 addition & 1 deletion src/components/IconSelector/DebouncedImage.tsx
@@ -1,6 +1,6 @@
import { Image, Loader, createStyles } from '@mantine/core';
import { useDebouncedValue } from '@mantine/hooks';
import { IconPhotoOff } from '@tabler/icons';
import { IconPhotoOff } from '@tabler/icons-react';

interface DebouncedImageProps {
width: number;
Expand Down
2 changes: 1 addition & 1 deletion src/components/IconSelector/IconSelector.tsx
Expand Up @@ -13,7 +13,7 @@ import {
SelectItemProps,
ScrollArea,
} from '@mantine/core';
import { IconSearch } from '@tabler/icons';
import { IconSearch } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { useGetDashboardIcons } from '../../hooks/icons/useGetDashboardIcons';
import { humanFileSize } from '../../tools/humanFileSize';
Expand Down
62 changes: 62 additions & 0 deletions src/components/Settings/Common/CacheButtons.tsx
@@ -0,0 +1,62 @@
import { Button, Group, MultiSelect, Stack, Title } from '@mantine/core';
import { useState } from 'react';
import { notifications } from '@mantine/notifications';
import { IconTrash } from '@tabler/icons-react';
import { queryClient } from '../../../tools/server/configurations/tanstack/queryClient.tool';

const data = [
{ value: 'ping', label: 'Ping queries' },
{ value: 'repository-icons', label: 'Remote/Local icons' },
{ value: 'calendar/medias', label: 'Medais from the Calendar' },
{ value: 'weather', label: 'Weather data' },
];

export function CacheButtons() {
const [value, setValue] = useState<string[]>([]);
return (
<Stack spacing="xs">
<Title order={4}>Cache cleaning</Title>
<MultiSelect
value={value}
searchable
onChange={setValue}
data={data}
label="Select the cache(s) to clear"
/>
<Group>
<Button
color="red"
variant="light"
onClick={() =>
queryClient.invalidateQueries(value).then(() =>
notifications.show({
title: 'Cache cleared',
message: `Cache for ${value.join(', ')} has been cleared`,
color: 'teal',
icon: <IconTrash />,
autoClose: 5000,
})
)
}
>
Clear selected queries
</Button>
<Button
onClick={() =>
queryClient.invalidateQueries().then(() =>
notifications.show({
title: 'Cache cleared',
message: 'All cache has been cleared',
color: 'teal',
icon: <IconTrash />,
autoClose: 5000,
})
)
}
>
Clear all cache
</Button>
</Group>
</Stack>
);
}
2 changes: 1 addition & 1 deletion src/components/Settings/Common/Config/ConfigActions.tsx
Expand Up @@ -10,7 +10,7 @@ import {
import { useDisclosure } from '@mantine/hooks';
import { openConfirmModal } from '@mantine/modals';
import { showNotification } from '@mantine/notifications';
import { IconAlertTriangle, IconCheck, IconCopy, IconDownload, IconTrash } from '@tabler/icons';
import { IconAlertTriangle, IconCheck, IconCopy, IconDownload, IconTrash } from '@tabler/icons-react';
import fileDownload from 'js-file-download';
import { Trans, useTranslation } from 'next-i18next';
import { useRouter } from 'next/router';
Expand Down
@@ -1,5 +1,5 @@
import { Alert, Paper, SegmentedControl, Space, Stack, TextInput, Title } from '@mantine/core';
import { IconInfoCircle } from '@tabler/icons';
import { IconInfoCircle } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { ChangeEventHandler, useState } from 'react';
import { useConfigContext } from '../../../../config/provider';
Expand Down
@@ -1,5 +1,5 @@
import { Accordion, Checkbox, Grid, Group, Stack, Text } from '@mantine/core';
import { IconBrush, IconChartCandle, IconCode, IconDragDrop, IconLayout } from '@tabler/icons';
import { IconBrush, IconChartCandle, IconCode, IconDragDrop, IconLayout } from '@tabler/icons-react';
import { i18n, useTranslation } from 'next-i18next';
import { ReactNode } from 'react';
import { GridstackConfiguration } from './Layout/GridstackConfiguration';
Expand Down
@@ -1,6 +1,6 @@
import { Alert, Button, Grid, Input, LoadingOverlay, Slider } from '@mantine/core';
import { useForm } from '@mantine/form';
import { IconCheck, IconReload } from '@tabler/icons';
import { IconCheck, IconReload } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { useState } from 'react';
import { useConfigContext } from '../../../../config/provider';
Expand Down
@@ -1,6 +1,6 @@
import { ActionIcon, Button, Tooltip } from '@mantine/core';
import { openContextModal } from '@mantine/modals';
import { IconApps } from '@tabler/icons';
import { IconApps } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { useCardStyles } from '../../../useCardStyles';

Expand Down
@@ -1,7 +1,7 @@
import { ActionIcon, Button, Group, Text, Title, Tooltip } from '@mantine/core';
import { useHotkeys, useWindowEvent } from '@mantine/hooks';
import { hideNotification, showNotification } from '@mantine/notifications';
import { IconEditCircle, IconEditCircleOff } from '@tabler/icons';
import { IconEditCircle, IconEditCircleOff } from '@tabler/icons-react';
import axios from 'axios';
import Consola from 'consola';
import { getCookie } from 'cookies-next';
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/header/Search.tsx
Expand Up @@ -12,7 +12,7 @@ import {
} from '@mantine/core';
import { useDebouncedValue, useHotkeys } from '@mantine/hooks';
import { showNotification } from '@mantine/notifications';
import { IconBrandYoutube, IconDownload, IconMovie, IconSearch } from '@tabler/icons';
import { IconBrandYoutube, IconDownload, IconMovie, IconSearch } from '@tabler/icons-react';
import { useQuery } from '@tanstack/react-query';
import axios from 'axios';
import { useTranslation } from 'next-i18next';
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/header/SettingsMenu.tsx
@@ -1,6 +1,6 @@
import { Badge, Button, Menu } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import { IconInfoCircle, IconMenu2, IconSettings } from '@tabler/icons';
import { IconInfoCircle, IconMenu2, IconSettings } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { useEditModeInformationStore } from '../../../hooks/useEditModeInformation';
import { AboutModal } from '../../Dashboard/Modals/AboutModal/AboutModal';
Expand Down
@@ -1,5 +1,5 @@
import { Menu, useMantineColorScheme } from '@mantine/core';
import { IconMoonStars, IconSun } from '@tabler/icons';
import { IconMoonStars, IconSun } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';

export const ColorSchemeSwitch = () => {
Expand Down
Expand Up @@ -2,7 +2,7 @@ import { Button, Code, Menu, PasswordInput, Stack, Text } from '@mantine/core';
import { useForm } from '@mantine/form';
import { openModal } from '@mantine/modals';
import { showNotification } from '@mantine/notifications';
import { IconEdit, IconEditOff } from '@tabler/icons';
import { IconEdit, IconEditOff } from '@tabler/icons-react';
import axios from 'axios';
import { useEditModeInformationStore } from '../../../../hooks/useEditModeInformation';

Expand Down
2 changes: 1 addition & 1 deletion src/modules/Docker/ContainerActionBar.tsx
Expand Up @@ -9,7 +9,7 @@ import {
IconRefresh,
IconRotateClockwise,
IconTrash,
} from '@tabler/icons';
} from '@tabler/icons-react';
import axios from 'axios';
import Dockerode from 'dockerode';
import { useTranslation } from 'next-i18next';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Docker/DockerModule.tsx
@@ -1,7 +1,7 @@
import { ActionIcon, Drawer, Text, Tooltip } from '@mantine/core';
import { useHotkeys } from '@mantine/hooks';
import { showNotification } from '@mantine/notifications';
import { IconBrandDocker, IconX } from '@tabler/icons';
import { IconBrandDocker, IconX } from '@tabler/icons-react';
import axios from 'axios';
import Docker from 'dockerode';
import { useTranslation } from 'next-i18next';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Docker/DockerTable.tsx
Expand Up @@ -9,7 +9,7 @@ import {
TextInput,
} from '@mantine/core';
import { useElementSize } from '@mantine/hooks';
import { IconSearch } from '@tabler/icons';
import { IconSearch } from '@tabler/icons-react';
import Dockerode from 'dockerode';
import { useTranslation } from 'next-i18next';
import { useEffect, useState } from 'react';
Expand Down
4 changes: 2 additions & 2 deletions src/modules/ModuleTypes.d.ts
Expand Up @@ -2,14 +2,14 @@
// Each module should have its own interface and call the following function:
// TODO: Add a function to register a module

import { TablerIcon } from '@tabler/icons';
import { Icon } from '@tabler/icons-react';

// Note: Maybe use context to keep track of the modules
// TODO: Remove this old component and the entire file
export interface IModule {
id: string;
title: string;
icon: TablerIcon;
icon: Icon;
component: React.ComponentType;
options?: Option;
padding?: PaddingOptions = {
Expand Down