From 97ee67cf645df368c6b208f9b9433964acd4a75b Mon Sep 17 00:00:00 2001 From: ThePotioner Date: Wed, 24 Sep 2025 00:45:31 +0900 Subject: [PATCH] feat: Implement page routing using `wouter` and add simple mock-up pages --- package.json | 4 +- src/components/PageContainer.tsx | 16 ++++-- src/components/Sidebar.tsx | 37 +++++++++++++- src/components/Topbar.tsx | 12 +++-- src/components/pages/Dashboard.tsx | 9 ++++ src/components/pages/Home.tsx | 9 ++++ src/components/pages/Todos.tsx | 9 ++++ src/components/pages/default/NotFound.tsx | 9 ++++ src/components/ui/button.tsx | 9 ++-- yarn.lock | 59 ++++++++++++++++++++--- 10 files changed, 153 insertions(+), 20 deletions(-) create mode 100644 src/components/pages/Dashboard.tsx create mode 100644 src/components/pages/Home.tsx create mode 100644 src/components/pages/Todos.tsx create mode 100644 src/components/pages/default/NotFound.tsx diff --git a/package.json b/package.json index d69b875..8f5a1f1 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,16 @@ "dependencies": { "@base-ui-components/react": "^1.0.0-beta.3", "@radix-ui/react-slot": "^1.2.3", + "@tabler/icons-react": "^3.35.0", "@tailwindcss/vite": "^4.1.13", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", - "lucide-react": "^0.543.0", + "lucide-react": "^0.544.0", "react": "^19.1.1", "react-dom": "^19.1.1", "tailwind-merge": "^3.3.1", "tailwindcss": "^4.1.13", + "wouter": "^3.7.1", "zustand": "^5.0.8" }, "devDependencies": { diff --git a/src/components/PageContainer.tsx b/src/components/PageContainer.tsx index 3ecee3a..8d616a5 100644 --- a/src/components/PageContainer.tsx +++ b/src/components/PageContainer.tsx @@ -1,12 +1,22 @@ +import { Route, Switch } from 'wouter'; + import Topbar from './Topbar'; +import Home from './pages/Home'; +import Dashboard from './pages/Dashboard'; +import Todos from './pages/Todos'; +import NotFound from './pages/default/NotFound'; + function PageContainer() { return (
-
-

Main Content

-
+ + + + + +
); } diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 39f93bd..154f73a 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,7 +1,40 @@ +import { Button } from '@/components/ui/button'; +import { useLocation, Link } from 'wouter'; +import { + IconHome, + IconCalendarWeekFilled, + IconLayoutCollage, + IconCheckupList, +} from '@tabler/icons-react'; + +// TODO: Add Sidebar Items(Pages, etc...) to Zustand Store +export const items = [ + { name: 'Home', href: '/', icon: IconHome }, + { name: 'Dashboard', href: '/dashboard', icon: IconLayoutCollage }, + { name: 'Todos', href: '/todos', icon: IconCheckupList }, + { name: 'Calendar', href: '/calendar', icon: IconCalendarWeekFilled }, +]; + function Sidebar() { + const [location] = useLocation(); return ( -