mirror of
https://github.com/Radiquum/AniX.git
synced 2025-05-03 03:19:41 +05:00
Back and Front: User Login
This commit is contained in:
parent
a03deddbc0
commit
32a4da1a31
8 changed files with 141 additions and 36 deletions
|
@ -5,23 +5,25 @@ import "material-dynamic-colors";
|
|||
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";
|
||||
|
||||
export function setMode(mode) {
|
||||
function setMode(mode) {
|
||||
localStorage.setItem("mode", mode);
|
||||
}
|
||||
export function getMode() {
|
||||
function getMode() {
|
||||
return localStorage.getItem("mode");
|
||||
}
|
||||
|
||||
export function setTheme(theme) {
|
||||
function setTheme(theme) {
|
||||
localStorage.setItem("theme", theme);
|
||||
}
|
||||
export function getTheme() {
|
||||
function getTheme() {
|
||||
return localStorage.getItem("theme");
|
||||
}
|
||||
|
||||
export const App = (props) => {
|
||||
const [colorPicker, setColorPicker] = useState(false);
|
||||
const userStore = useUserStore();
|
||||
|
||||
const theme = async (from) => {
|
||||
setTheme(from);
|
||||
|
@ -45,6 +47,11 @@ export const App = (props) => {
|
|||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
userStore.checkAuth();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<body>
|
||||
<div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue