Add placeholder settings page

This commit is contained in:
Szymon Nowakowski
2024-12-25 18:14:38 +01:00
parent 135d54908f
commit 46763a95c1
3 changed files with 17 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import { Home } from "@/routes/Home";
import { Login } from "@/routes/Login";
import { Piece } from "@/routes/Piece";
import { Root } from "@/routes/Root";
import { Settings } from "@/routes/Settings";
import { lazy, StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
@@ -31,6 +32,10 @@ const router = createBrowserRouter([
},
],
},
{
path: "settings",
Component: Settings,
},
],
},
{

View File

@@ -26,7 +26,7 @@ export function Root() {
setUser(data);
};
useEffect(() => void(init()), []);
useEffect(() => void init(), []);
const onLogoutClick = async () => {
const { error } = await client.logout.post();
@@ -60,8 +60,10 @@ export function Root() {
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem>
<DropdownMenuItem asChild>
<Link to="/settings">
<Settings />Ustawienia
</Link>
</DropdownMenuItem>
<DropdownMenuItem onClick={onLogoutClick}>
<LogOut />Wyloguj się

View File

@@ -0,0 +1,7 @@
export function Settings() {
return (
<div className="p-4 overflow-y-auto grow flex flex-col items-center justify-center gap-4">
<div>Tutaj by były ustawienia, gdyby były.</div>
</div>
);
}