mirror of
https://github.com/BarkProductions/barkman.git
synced 2026-06-12 22:11:54 +00:00
Made router work
This commit is contained in:
Generated
+1
@@ -10,6 +10,7 @@
|
||||
"dependencies": {
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-router": "^7.1.1",
|
||||
"react-router-dom": "^7.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"dependencies": {
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-router": "^7.1.1",
|
||||
"react-router-dom": "^7.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
+9
-10
@@ -1,21 +1,20 @@
|
||||
import './App.css'
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Routes, Route} from 'react-router';
|
||||
import Home from './pages/home.tsx';
|
||||
import Inventory from "./pages/inventory.tsx";
|
||||
|
||||
|
||||
function App() {
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<h1>BarkMan</h1>
|
||||
</div>
|
||||
<p>
|
||||
ARFF ARFF BARK BARK
|
||||
</p>
|
||||
<Routes>
|
||||
<Route index element={<Home />} />
|
||||
<Route path="inventory" element={<Inventory />} />
|
||||
</Routes>
|
||||
|
||||
|
||||
<Link to="/inventory">
|
||||
<button>Inventory</button>
|
||||
</Link>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,9 +2,12 @@ import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './index.css'
|
||||
import App from './App.tsx'
|
||||
import { BrowserRouter } from "react-router";
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
<BrowserRouter>
|
||||
<App />
|
||||
</BrowserRouter>
|
||||
</StrictMode>,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import '../App.css'
|
||||
import {Link} from "react-router";
|
||||
|
||||
|
||||
function Home() {
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<h1>Home</h1>
|
||||
</div>
|
||||
<p>
|
||||
ARFF ARFF BARK BARK
|
||||
</p>
|
||||
<Link to="/inventory">
|
||||
<button>Inventory</button>
|
||||
</Link>
|
||||
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Home
|
||||
@@ -1,4 +1,4 @@
|
||||
import './App.css'
|
||||
import '../App.css'
|
||||
|
||||
function Inventory() {
|
||||
|
||||
Reference in New Issue
Block a user