From be8f2d6d183e5206f932be1113e0da7db2a2277a Mon Sep 17 00:00:00 2001 From: Anderson Shindy Oki Date: Fri, 7 Jun 2024 12:00:42 +0900 Subject: Upgraded mantine to v7.x --- frontend/src/pages/Settings/General/index.tsx | 17 ++++++----- frontend/src/pages/Settings/Languages/equals.tsx | 2 +- frontend/src/pages/Settings/Languages/table.tsx | 5 ++-- .../pages/Settings/Notifications/components.tsx | 2 +- .../src/pages/Settings/Providers/components.tsx | 30 +++++++++++--------- frontend/src/pages/Settings/Radarr/index.tsx | 2 +- frontend/src/pages/Settings/Sonarr/index.tsx | 2 +- frontend/src/pages/Settings/Subtitles/index.tsx | 2 +- .../src/pages/Settings/components/Card.module.scss | 9 ++++++ frontend/src/pages/Settings/components/Card.tsx | 33 ++++------------------ frontend/src/pages/Settings/components/Layout.tsx | 2 +- .../src/pages/Settings/components/LayoutModal.tsx | 2 +- frontend/src/pages/Settings/components/Message.tsx | 2 +- .../src/pages/Settings/components/Section.test.tsx | 8 +++--- frontend/src/pages/Settings/components/Section.tsx | 2 +- .../src/pages/Settings/components/collapse.tsx | 2 +- .../src/pages/Settings/components/forms.test.tsx | 4 +-- frontend/src/pages/Settings/components/forms.tsx | 5 ++++ frontend/src/pages/Settings/components/index.tsx | 4 +-- .../src/pages/Settings/components/pathMapper.tsx | 2 +- 20 files changed, 65 insertions(+), 72 deletions(-) create mode 100644 frontend/src/pages/Settings/components/Card.module.scss (limited to 'frontend/src/pages/Settings') diff --git a/frontend/src/pages/Settings/General/index.tsx b/frontend/src/pages/Settings/General/index.tsx index 8cc5ea8c3..bec3f946f 100644 --- a/frontend/src/pages/Settings/General/index.tsx +++ b/frontend/src/pages/Settings/General/index.tsx @@ -4,7 +4,7 @@ import { faClipboard, faSync, } from "@fortawesome/free-solid-svg-icons"; -import { Group as MantineGroup, Text as MantineText } from "@mantine/core"; +import { Box, Group as MantineGroup, Text as MantineText } from "@mantine/core"; import { useClipboard } from "@mantine/hooks"; import { FunctionComponent, useState } from "react"; import { @@ -54,7 +54,7 @@ const SettingsGeneralView: FunctionComponent = () => { > s.general.base_url?.slice(1) ?? "", @@ -87,7 +87,7 @@ const SettingsGeneralView: FunctionComponent = () => { rightSectionWidth={95} rightSectionProps={{ style: { justifyContent: "flex-end" } }} rightSection={ - + { // Clipboard API is only available in secure contexts See: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#interfaces window.isSecureContext && ( @@ -204,13 +204,12 @@ const SettingsGeneralView: FunctionComponent = () => { - Days - + + + Days + + } > diff --git a/frontend/src/pages/Settings/Languages/equals.tsx b/frontend/src/pages/Settings/Languages/equals.tsx index a4fe95eee..a417059ab 100644 --- a/frontend/src/pages/Settings/Languages/equals.tsx +++ b/frontend/src/pages/Settings/Languages/equals.tsx @@ -355,7 +355,7 @@ const EqualsTable: FunctionComponent = () => { return ( <> - diff --git a/frontend/src/pages/Settings/Languages/table.tsx b/frontend/src/pages/Settings/Languages/table.tsx index a1ee217e8..86a227207 100644 --- a/frontend/src/pages/Settings/Languages/table.tsx +++ b/frontend/src/pages/Settings/Languages/table.tsx @@ -70,7 +70,7 @@ const Table: FunctionComponent = () => { const items = row.value; const cutoff = row.row.original.cutoff; return ( - + {items.map((v) => { const isCutoff = v.id === cutoff || cutoff === anyCutoff; return ( @@ -128,7 +128,7 @@ const Table: FunctionComponent = () => { Cell: ({ row }) => { const profile = row.original; return ( - + { diff --git a/frontend/src/pages/Settings/Radarr/index.tsx b/frontend/src/pages/Settings/Radarr/index.tsx index 8cd038ab8..8805aeed8 100644 --- a/frontend/src/pages/Settings/Radarr/index.tsx +++ b/frontend/src/pages/Settings/Radarr/index.tsx @@ -30,7 +30,7 @@ const SettingsRadarrView: FunctionComponent = () => { s.radarr.base_url?.slice(1) ?? "", diff --git a/frontend/src/pages/Settings/Sonarr/index.tsx b/frontend/src/pages/Settings/Sonarr/index.tsx index 1d2125568..0f60d70a8 100644 --- a/frontend/src/pages/Settings/Sonarr/index.tsx +++ b/frontend/src/pages/Settings/Sonarr/index.tsx @@ -32,7 +32,7 @@ const SettingsSonarrView: FunctionComponent = () => { s.sonarr.base_url?.slice(1) ?? "", diff --git a/frontend/src/pages/Settings/Subtitles/index.tsx b/frontend/src/pages/Settings/Subtitles/index.tsx index f2dec69ac..c4dffd227 100644 --- a/frontend/src/pages/Settings/Subtitles/index.tsx +++ b/frontend/src/pages/Settings/Subtitles/index.tsx @@ -501,7 +501,7 @@ const SettingsSubtitlesView: FunctionComponent = () => { label="Command" settingKey="settings-general-postprocessing_cmd" > - +
{commandOptionElements}
diff --git a/frontend/src/pages/Settings/components/Card.module.scss b/frontend/src/pages/Settings/components/Card.module.scss new file mode 100644 index 000000000..746e55e65 --- /dev/null +++ b/frontend/src/pages/Settings/components/Card.module.scss @@ -0,0 +1,9 @@ +.card { + border-radius: var(--mantine-radius-sm); + border: 1px solid var(--mantine-color-gray-7); + + &:hover { + box-shadow: var(--mantine-shadow-md); + border: 1px solid $color-brand-5; + } +} diff --git a/frontend/src/pages/Settings/components/Card.tsx b/frontend/src/pages/Settings/components/Card.tsx index 4f3bd4fbf..6e4b58f47 100644 --- a/frontend/src/pages/Settings/components/Card.tsx +++ b/frontend/src/pages/Settings/components/Card.tsx @@ -1,30 +1,8 @@ import { faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { - Center, - createStyles, - Stack, - Text, - UnstyledButton, -} from "@mantine/core"; +import { Center, Stack, Text, UnstyledButton } from "@mantine/core"; import { FunctionComponent } from "react"; - -const useCardStyles = createStyles((theme) => { - return { - card: { - borderRadius: theme.radius.sm, - border: `1px solid ${theme.colors.gray[7]}`, - - "&:hover": { - boxShadow: theme.shadows.md, - border: `1px solid ${theme.colors.brand[5]}`, - }, - }, - stack: { - height: "100%", - }, - }; -}); +import styles from "./Card.module.scss"; interface CardProps { header?: string; @@ -39,16 +17,15 @@ export const Card: FunctionComponent = ({ plus, onClick, }) => { - const { classes } = useCardStyles(); return ( - + {plus ? (
) : ( - - {header} + + {header} )} diff --git a/frontend/src/pages/Settings/components/Layout.tsx b/frontend/src/pages/Settings/components/Layout.tsx index b20c8092b..5fb6dbbed 100644 --- a/frontend/src/pages/Settings/components/Layout.tsx +++ b/frontend/src/pages/Settings/components/Layout.tsx @@ -73,7 +73,7 @@ const Layout: FunctionComponent = (props) => { icon={faSave} loading={isMutating} disabled={totalStagedCount === 0} - rightIcon={ + rightSection={ diff --git a/frontend/src/pages/Settings/components/LayoutModal.tsx b/frontend/src/pages/Settings/components/LayoutModal.tsx index cb4d5a1b5..6150295e4 100644 --- a/frontend/src/pages/Settings/components/LayoutModal.tsx +++ b/frontend/src/pages/Settings/components/LayoutModal.tsx @@ -74,7 +74,7 @@ const LayoutModal: FunctionComponent = (props) => { - + ); @@ -107,7 +107,7 @@ export const ProviderTestButton: FunctionComponent<{ }, [testUrl]); return ( - ); diff --git a/frontend/src/pages/Settings/components/pathMapper.tsx b/frontend/src/pages/Settings/components/pathMapper.tsx index 8bb3514b7..38fbb27e9 100644 --- a/frontend/src/pages/Settings/components/pathMapper.tsx +++ b/frontend/src/pages/Settings/components/pathMapper.tsx @@ -141,7 +141,7 @@ export const PathMappingTable: FunctionComponent = ({ type }) => { columns={columns} data={data} > - -- cgit v1.2.3