diff --git a/front/packages/primitives/src/icons.tsx b/front/packages/primitives/src/icons.tsx index a47ac4a7..aab3bedc 100644 --- a/front/packages/primitives/src/icons.tsx +++ b/front/packages/primitives/src/icons.tsx @@ -33,8 +33,10 @@ declare module "react" { ): (props: P & React.RefAttributes) => React.ReactElement | null; } +export type Icon =ComponentType; + type IconProps = { - icon: ComponentType; + icon: Icon; color?: Breakpoint; size?: YoshikiStyle; }; diff --git a/front/packages/ui/src/settings/index.tsx b/front/packages/ui/src/settings/index.tsx index da367c1f..42c93ae8 100644 --- a/front/packages/ui/src/settings/index.tsx +++ b/front/packages/ui/src/settings/index.tsx @@ -19,14 +19,27 @@ */ import { QueryIdentifier, QueryPage, User, UserP, setUserTheme, useUserTheme } from "@kyoo/models"; -import { Container, P, Select, ts } from "@kyoo/primitives"; +import { Container, H1, Icon, P, Select, SubP, imageBorderRadius, ts } from "@kyoo/primitives"; import { DefaultLayout } from "../layout"; -import { ReactNode } from "react"; +import { ReactElement, ReactNode } from "react"; import { useTranslation } from "react-i18next"; import { ScrollView, View } from "react-native"; -import { useYoshiki } from "yoshiki/native"; +import { px, rem, useYoshiki } from "yoshiki/native"; -const Preference = ({ label, children, ...props }: { label: string; children: ReactNode }) => { +import Theme from "@material-symbols/svg-400/outlined/dark_mode.svg"; + +const Preference = ({ + icon, + label, + description, + children, + ...props +}: { + icon: Icon; + label: string; + description: string; + children: ReactNode; +}) => { const { css } = useYoshiki(); return ( @@ -42,12 +55,32 @@ const Preference = ({ label, children, ...props }: { label: string; children: Re props, )} > -

{label}

- {children} + + + +

{label}

+ {description} +
+
+ {children} ); }; +const SettingsContainer = ({ children, title }: { children: ReactElement; title: string }) => { + const { css } = useYoshiki(); + return ( + +

{title}

+ theme.variant.background, borderRadius: px(imageBorderRadius) })} + > + {children} + +
+ ); +}; + const query: QueryIdentifier = { parser: UserP, path: ["auth", "me"], @@ -59,17 +92,21 @@ export const SettingsPage: QueryPage = () => { const theme = useUserTheme("auto"); return ( - - + +