mirror of
https://github.com/hex248/tsos.git
synced 2026-02-07 18:23:05 +00:00
layout and settings page
This commit is contained in:
27
src/Layout.tsx
Normal file
27
src/Layout.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import ThemeToggle from "@/components/theme-toggle";
|
||||
import { Link, useLocation } from "react-router-dom";
|
||||
import { Home, Settings } from "lucide-react";
|
||||
|
||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||
const router = useLocation();
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-[100vh] items-center">
|
||||
<header className="w-full flex items-center justify-between border-b h-12 p-2">
|
||||
<ThemeToggle />
|
||||
<h1 className="text-3xl font-bold">The Shape of Sound</h1>
|
||||
{router.pathname !== "/settings" && (
|
||||
<Link to="/settings" className="">
|
||||
<Settings />
|
||||
</Link>
|
||||
)}
|
||||
{router.pathname !== "/" && (
|
||||
<Link to="/" className="">
|
||||
<Home />
|
||||
</Link>
|
||||
)}
|
||||
</header>
|
||||
<main className="w-full flex-1 p-4 flex items-center justify-center">{children}</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user