From bc05afb8c9ef0db758f66957dbbb0fb7fdef2093 Mon Sep 17 00:00:00 2001 From: Jaewook Ahn Date: Sat, 6 Apr 2024 21:05:38 +0900 Subject: [PATCH] feat(app): add settings app items - add about menu - add color mode menu - add blur effect menu - add language menu - remove react-draggable deps --- app/components/Settings/Settings.css.ts | 20 +++++++++-- app/components/Settings/index.tsx | 46 +++++++++++++++++++++++-- package.json | 1 - yarn.lock | 13 ------- 4 files changed, 62 insertions(+), 18 deletions(-) diff --git a/app/components/Settings/Settings.css.ts b/app/components/Settings/Settings.css.ts index 1940c8f..c1d2c6b 100644 --- a/app/components/Settings/Settings.css.ts +++ b/app/components/Settings/Settings.css.ts @@ -1,20 +1,36 @@ import { style } from "@vanilla-extract/css"; export const container = style({ - padding: "16px 12px", + padding: "14px 20px", }); export const list = style({ - padding: "12px 8px", + padding: "0 8px", borderRadius: 4, border: "1px solid #5c5c5c", }); export const row = style({ display: "flex", + alignItems: "center", + minHeight: 48, + padding: "0 4px", + fontSize: 14, + selectors: { + "&:nth-child(n+2)": { + borderTop: "1px solid rgb(63, 58, 58)", + }, + }, }); export const rowLabel = style({ fontSize: 14, color: "#fff", + marginRight: "auto", +}); + +export const infoText = style({ + marginTop: 16, + fontSize: 12, + color: "rgba(255, 255, 255, 0.6)" }); diff --git a/app/components/Settings/index.tsx b/app/components/Settings/index.tsx index f085385..3c5abc6 100644 --- a/app/components/Settings/index.tsx +++ b/app/components/Settings/index.tsx @@ -1,4 +1,9 @@ +"use client"; +import { useCallback, useState } from "react"; import type { PropsWithChildren } from "react"; +import { PiCaretRight } from "react-icons/pi"; + +import { Select, Options } from "../Select"; import { Window } from "../Window"; import * as css from "./Settings.css"; @@ -11,20 +16,57 @@ const Row = (props: PropsWithChildren) => { return (

{label}

- {children} +
{children}
); }; +const COLOR_MODE_OPTIONS: Options = [ + { key: "color-mode-option-light", label: "Light" }, + { key: "color-mode-option-dark", label: "Dark" }, +]; + +const BLUR_EFFECT_OPTIONS: Options = [ + { key: "blur-on", label: "On" }, + { key: "blur-off", label: "Off" }, +]; + +const LANGUAGE_OPTIONS: Options = [ + { key: "lang-en", label: "English" }, + { key: "lang-ko", label: "한국어" }, +]; + export const Settings = () => { + const [colorMode, setColorMode] = useState("Dark"); + const [blurEnabled, setBlurEnabled] = useState("Off"); + const [language, setLanguage] = useState("English"); + + const handleColorModeChange = useCallback((value: string) => { + setColorMode(value); + }, []); + + const handleLanguageChange = useCallback((value: string) => { + setLanguage(value); + }, []); + return (
+ + + - Auto / Light / Dark + {}} /> + + +