From 3171bebc905dd158ea8c78370d69edfd2514cb37 Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Mon, 2 Dec 2024 17:08:13 -0800 Subject: [PATCH] feat: setting up an outline in case i have an idea --- .../app/view/settingsview/settingsview.scss | 0 .../app/view/settingsview/settingsview.tsx | 58 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 frontend/app/view/settingsview/settingsview.scss create mode 100644 frontend/app/view/settingsview/settingsview.tsx diff --git a/frontend/app/view/settingsview/settingsview.scss b/frontend/app/view/settingsview/settingsview.scss new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/app/view/settingsview/settingsview.tsx b/frontend/app/view/settingsview/settingsview.tsx new file mode 100644 index 000000000..cf7e8f86f --- /dev/null +++ b/frontend/app/view/settingsview/settingsview.tsx @@ -0,0 +1,58 @@ +// Copyright 2024, Command Line Inc. +// SPDX-License-Identifier: Apache-2.0 + +import { atoms } from "@/app/store/global"; +import { Atom, atom, PrimitiveAtom, useAtomValue } from "jotai"; +import "./settingsview.scss"; + +class SettingsViewModel implements ViewModel { + viewType: string; + showTocAtom: PrimitiveAtom; + endIconButtons: Atom; + + constructor() { + this.viewType = "settings"; + this.showTocAtom = atom(false); + } +} + +function makeSettingsViewModel() { + return new SettingsViewModel(); +} + +function SettingsRow(settingKey: string, settingValue: unknown) { + return
; +} + +function SettingsRowString(settingKey: string, settingValue: unknown) { + return ( +
+

{settingKey}

+ +
+ ); +} + +function SettingsRowNum(settingKey: string, settingValue: unknown) { + return ( +
+

{settingKey}

+
+ ); +} + +function SettingsRowBool(settingKey: string, settingValue: unknown) { + return ( +
+

{settingKey}

+
+ ); +} + +function SettingsView({ model }: { model: SettingsViewModel }) { + const baseSettings = useAtomValue(atoms.settingsAtom); + + return
{Object.entries(baseSettings).map(([key, value]) => SettingsRow(key, value))}
; +} + +export { makeSettingsViewModel, SettingsView, SettingsViewModel };