From 643b8cfbccc039442c206c1d3c898a64ce69598e Mon Sep 17 00:00:00 2001 From: Drew Rautenberg Date: Sat, 11 Jan 2025 21:25:17 -0600 Subject: [PATCH] Made router work --- barkmanui/package-lock.json | 1 + barkmanui/package.json | 1 + barkmanui/src/App.tsx | 19 +++++++-------- barkmanui/src/main.tsx | 5 +++- barkmanui/src/pages/home.tsx | 24 +++++++++++++++++++ .../page.tsx => pages/inventory.tsx} | 2 +- 6 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 barkmanui/src/pages/home.tsx rename barkmanui/src/{inventory/page.tsx => pages/inventory.tsx} (92%) diff --git a/barkmanui/package-lock.json b/barkmanui/package-lock.json index 152c02a..8c59443 100644 --- a/barkmanui/package-lock.json +++ b/barkmanui/package-lock.json @@ -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": { diff --git a/barkmanui/package.json b/barkmanui/package.json index 11a79ce..385ca3d 100644 --- a/barkmanui/package.json +++ b/barkmanui/package.json @@ -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": { diff --git a/barkmanui/src/App.tsx b/barkmanui/src/App.tsx index 670ed8d..1952284 100644 --- a/barkmanui/src/App.tsx +++ b/barkmanui/src/App.tsx @@ -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 ( <> -
-

BarkMan

-
-

- ARFF ARFF BARK BARK -

+ + } /> + } /> + + - - - ) } diff --git a/barkmanui/src/main.tsx b/barkmanui/src/main.tsx index bef5202..671031a 100644 --- a/barkmanui/src/main.tsx +++ b/barkmanui/src/main.tsx @@ -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( - + + + , ) diff --git a/barkmanui/src/pages/home.tsx b/barkmanui/src/pages/home.tsx new file mode 100644 index 0000000..4d8e6f9 --- /dev/null +++ b/barkmanui/src/pages/home.tsx @@ -0,0 +1,24 @@ +import '../App.css' +import {Link} from "react-router"; + + +function Home() { + + + return ( + <> +
+

Home

+
+

+ ARFF ARFF BARK BARK +

+ + + + + + ) +} + +export default Home \ No newline at end of file diff --git a/barkmanui/src/inventory/page.tsx b/barkmanui/src/pages/inventory.tsx similarity index 92% rename from barkmanui/src/inventory/page.tsx rename to barkmanui/src/pages/inventory.tsx index 4c81e53..fe3ce69 100644 --- a/barkmanui/src/inventory/page.tsx +++ b/barkmanui/src/pages/inventory.tsx @@ -1,4 +1,4 @@ -import './App.css' +import '../App.css' function Inventory() {