Back and Front: User Login

This commit is contained in:
Kentai Radiquum 2024-04-23 23:59:24 +05:00
parent a03deddbc0
commit 32a4da1a31
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
8 changed files with 141 additions and 36 deletions

View file

@ -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>