mirror of
https://codeberg.org/andyscott/ExerciseTracker.git
synced 2024-12-21 11:43:10 -05:00
Added header, footer, and nav
This commit is contained in:
parent
ff73caab92
commit
67f3a70130
1 changed files with 18 additions and 2 deletions
|
@ -4,22 +4,38 @@ import { BrowserRouter as Router, Route } from "react-router-dom";
|
||||||
import HomePage from "./pages/HomePage";
|
import HomePage from "./pages/HomePage";
|
||||||
import CreatePage from "./pages/CreatePage";
|
import CreatePage from "./pages/CreatePage";
|
||||||
import EditPage from "./pages/EditPage";
|
import EditPage from "./pages/EditPage";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
const [exerciseToEdit, setExerciseToEdit] = useState();
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<Router>
|
<Router>
|
||||||
<div className="App-header">
|
<div className="App-header">
|
||||||
|
<header>
|
||||||
|
<h1>Exercise Tracker</h1>
|
||||||
|
<p>Create, edit, and delete exercises</p>
|
||||||
|
</header>
|
||||||
<Route path="/" exact>
|
<Route path="/" exact>
|
||||||
<HomePage />
|
<HomePage setExerciseToEdit={setExerciseToEdit} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/create">
|
<Route path="/create">
|
||||||
<CreatePage />
|
<CreatePage />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/edit">
|
<Route path="/edit">
|
||||||
<EditPage />
|
<EditPage exerciseToEdit={exerciseToEdit} />
|
||||||
</Route>
|
</Route>
|
||||||
</div>
|
</div>
|
||||||
|
<nav>
|
||||||
|
<div>
|
||||||
|
<Link to="/">Home </Link>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Link to="/create">Create</Link>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<footer>© 2022 Andrew Scott</footer>
|
||||||
</Router>
|
</Router>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue