mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-07 00:34:41 +00:00
frontend: add settings boilerplate
This commit is contained in:
parent
c2656fbab9
commit
baaa67f2ab
3 changed files with 41 additions and 1 deletions
|
@ -6,6 +6,7 @@ import { NavigationRail } from "@/app/components/NavigationRail/NavigationRail";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { ColorPicker } from "@/app/components/ColorPicker/ColorPicker";
|
import { ColorPicker } from "@/app/components/ColorPicker/ColorPicker";
|
||||||
import { useUserStore } from "./store/user-store";
|
import { useUserStore } from "./store/user-store";
|
||||||
|
import Settings from "./components/Settings/Settings";
|
||||||
|
|
||||||
function setMode(mode) {
|
function setMode(mode) {
|
||||||
localStorage.setItem("mode", mode);
|
localStorage.setItem("mode", mode);
|
||||||
|
@ -23,6 +24,7 @@ function getTheme() {
|
||||||
|
|
||||||
export const App = (props) => {
|
export const App = (props) => {
|
||||||
const [colorPicker, setColorPicker] = useState(false);
|
const [colorPicker, setColorPicker] = useState(false);
|
||||||
|
const [settingsPopup, setSettingsPopup] = useState(false);
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
const theme = async (from) => {
|
const theme = async (from) => {
|
||||||
|
@ -57,7 +59,9 @@ export const App = (props) => {
|
||||||
<div>
|
<div>
|
||||||
<NavigationRail
|
<NavigationRail
|
||||||
colorPicker={colorPicker}
|
colorPicker={colorPicker}
|
||||||
|
settingsPopup={settingsPopup}
|
||||||
setColorPicker={setColorPicker}
|
setColorPicker={setColorPicker}
|
||||||
|
setSettingsPopup={setSettingsPopup}
|
||||||
/>
|
/>
|
||||||
{colorPicker && (
|
{colorPicker && (
|
||||||
<ColorPicker
|
<ColorPicker
|
||||||
|
@ -67,6 +71,7 @@ export const App = (props) => {
|
||||||
setColorPicker={setColorPicker}
|
setColorPicker={setColorPicker}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{settingsPopup && <Settings />}
|
||||||
</div>
|
</div>
|
||||||
<main className="responsive">{props.children}</main>
|
<main className="responsive">{props.children}</main>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -78,7 +78,10 @@ export const NavigationRail = (props) => {
|
||||||
})}
|
})}
|
||||||
|
|
||||||
<span className="max"></span>
|
<span className="max"></span>
|
||||||
<button className="circle transparent">
|
<button
|
||||||
|
className="circle transparent"
|
||||||
|
onClick={() => props.setSettingsPopup(!props.settingsPopup)}
|
||||||
|
>
|
||||||
<i>settings</i>
|
<i>settings</i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
32
frontend/app/components/Settings/Settings.jsx
Normal file
32
frontend/app/components/Settings/Settings.jsx
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
export default function Settings() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<dialog
|
||||||
|
className="active left round bottom small"
|
||||||
|
style={{ blockSize: "unset" }}
|
||||||
|
>
|
||||||
|
<h5>Настройки</h5>
|
||||||
|
<nav className="wrap">
|
||||||
|
<div class="max">
|
||||||
|
<h6 className="small">сохранение в истории просмотров</h6>
|
||||||
|
</div>
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" />
|
||||||
|
<span></span>
|
||||||
|
</label>
|
||||||
|
</nav>
|
||||||
|
<li className="small-divider"></li>
|
||||||
|
<nav className="wrap small-space">
|
||||||
|
<button className="red">
|
||||||
|
<i>delete_forever</i>
|
||||||
|
<span>Удалить все настройки</span>
|
||||||
|
</button>
|
||||||
|
<button className="red">
|
||||||
|
<i>delete_history</i>
|
||||||
|
<span>Удалить историю поиска</span>
|
||||||
|
</button>
|
||||||
|
</nav>
|
||||||
|
</dialog>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue