generated from lucien/actix-react-template
Make a better article section and add the article page.
This commit is contained in:
parent
9562eb98dc
commit
e121090433
7 changed files with 111 additions and 26 deletions
|
@ -2,13 +2,20 @@ import { BrowserRouter, Route, Routes } from "react-router";
|
|||
import { createRoot } from 'react-dom/client'
|
||||
import MainPage from "./pages/MainPage.tsx";
|
||||
import GamePage from "./pages/GamePage.tsx";
|
||||
import ArticlePage from "./pages/ArticlePage.tsx";
|
||||
import './index.css'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
// Main page
|
||||
<Route path="/" element={<MainPage />} />
|
||||
// Game page
|
||||
<Route path="/game" element={<GamePage />} />
|
||||
// Article page (dynamic route)
|
||||
<Route path="/article/:id" element={<ArticlePage />} />
|
||||
// Not found
|
||||
<Route path="*" element={<div>Not Found</div>} />
|
||||
</Routes>
|
||||
</BrowserRouter>,
|
||||
</BrowserRouter>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue