frontend: add settings boilerplate

This commit is contained in:
Kentai Radiquum 2024-04-27 23:41:53 +05:00
parent c2656fbab9
commit baaa67f2ab
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
3 changed files with 41 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import { NavigationRail } from "@/app/components/NavigationRail/NavigationRail";
import { useEffect, useState } from "react";
import { ColorPicker } from "@/app/components/ColorPicker/ColorPicker";
import { useUserStore } from "./store/user-store";
import Settings from "./components/Settings/Settings";
function setMode(mode) {
localStorage.setItem("mode", mode);
@ -23,6 +24,7 @@ function getTheme() {
export const App = (props) => {
const [colorPicker, setColorPicker] = useState(false);
const [settingsPopup, setSettingsPopup] = useState(false);
const userStore = useUserStore();
const theme = async (from) => {
@ -57,7 +59,9 @@ export const App = (props) => {
<div>
<NavigationRail
colorPicker={colorPicker}
settingsPopup={settingsPopup}
setColorPicker={setColorPicker}
setSettingsPopup={setSettingsPopup}
/>
{colorPicker && (
<ColorPicker
@ -67,6 +71,7 @@ export const App = (props) => {
setColorPicker={setColorPicker}
/>
)}
{settingsPopup && <Settings />}
</div>
<main className="responsive">{props.children}</main>
</body>