Skip to content

Commit b17f210

Browse files
committed
chore: add basic pages
1 parent 53d042b commit b17f210

File tree

11 files changed

+119
-77
lines changed

11 files changed

+119
-77
lines changed

package-lock.json

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"lucide-react": "^0.475.0",
2121
"react": "^19.0.0",
2222
"react-dom": "^19.0.0",
23+
"react-router": "^7.2.0",
2324
"tailwind-merge": "^3.0.1",
2425
"tailwindcss": "^4.0.7",
2526
"tailwindcss-animate": "^1.0.7"

src/App.css

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/App.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/components/AppSidebar.tsx

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Bitcoin, Calendar, Home, Inbox, Search, Settings } from "lucide-react"
1+
import { Bitcoin, Home, Inbox, Settings } from "lucide-react"
2+
import { NavLink } from "react-router";
23

34
import {
45
Sidebar,
@@ -15,32 +16,22 @@ import {
1516
const items = [
1617
{
1718
title: "Home",
18-
url: "#",
19+
url: "/",
1920
icon: Home,
2021
},
2122
{
2223
title: "Balance",
23-
url: "#",
24+
url: "/balances",
2425
icon: Bitcoin,
2526
},
2627
{
2728
title: "Quotes",
28-
url: "#",
29+
url: "/quotes",
2930
icon: Inbox,
3031
},
31-
/*{
32-
title: "Calendar",
33-
url: "#",
34-
icon: Calendar,
35-
},*/
36-
{
37-
title: "Search",
38-
url: "#",
39-
icon: Search,
40-
},
4132
{
4233
title: "Settings",
43-
url: "#",
34+
url: "/settings",
4435
icon: Settings,
4536
},
4637
]
@@ -56,10 +47,10 @@ export function AppSidebar() {
5647
{items.map((item) => (
5748
<SidebarMenuItem key={item.title}>
5849
<SidebarMenuButton asChild>
59-
<a href={item.url}>
50+
<NavLink to={item.url}>
6051
<item.icon />
6152
<span>{item.title}</span>
62-
</a>
53+
</NavLink>
6354
</SidebarMenuButton>
6455
</SidebarMenuItem>
6556
))}

src/layout.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar"
22
import { AppSidebar } from "@/components/AppSidebar"
3+
import { Outlet } from "react-router"
34

4-
export default function Layout({ children }: { children: React.ReactNode }) {
5+
export default function Layout() {
56
return (
67
<SidebarProvider>
78
<AppSidebar />
8-
<main>
9-
<SidebarTrigger />
10-
{children}
9+
<main className="flex flex-col px-2 py-2">
10+
<div>
11+
<SidebarTrigger />
12+
</div>
13+
<div className="flex flex-col py-2">
14+
<Outlet />
15+
</div>
1116
</main>
1217
</SidebarProvider>
1318
)

src/main.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
3+
import { BrowserRouter, Route, Routes } from "react-router";
34
import './index.css'
4-
import App from './App.tsx'
5+
import Layout from './layout';
6+
import HomePage from './pages/home/HomePage'
7+
import BalancesPage from './pages/balances/BalancesPage'
8+
import QuotesPage from './pages/quotes/QuotesPage';
9+
import SettingsPage from './pages/settings/SettingsPage';
510

611
createRoot(document.getElementById('root')!).render(
712
<StrictMode>
8-
<App />
13+
<BrowserRouter>
14+
<Routes>
15+
<Route element={<Layout />}>
16+
<Route index element={<HomePage />} />
17+
<Route path="balances" element={<BalancesPage />} />
18+
<Route path="quotes" element={<QuotesPage />} />
19+
<Route path="settings" element={<SettingsPage />} />
20+
</Route>
21+
</Routes>
22+
</BrowserRouter>
923
</StrictMode>,
24+
1025
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default function BalancesPage() {
2+
return (
3+
<>
4+
<h2>Balances</h2>
5+
</>
6+
)
7+
}
8+

src/pages/home/HomePage.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default function HomePage() {
2+
return (
3+
<>
4+
<h2>Home</h2>
5+
</>
6+
)
7+
}
8+

src/pages/quotes/QuotesPage.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default function QuotesPage() {
2+
return (
3+
<>
4+
<h2>Quotes</h2>
5+
</>
6+
)
7+
}
8+

0 commit comments

Comments
 (0)