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 CreatePage from "./pages/CreatePage";
|
||||
import EditPage from "./pages/EditPage";
|
||||
import { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
function App() {
|
||||
const [exerciseToEdit, setExerciseToEdit] = useState();
|
||||
return (
|
||||
<div className="App">
|
||||
<Router>
|
||||
<div className="App-header">
|
||||
<header>
|
||||
<h1>Exercise Tracker</h1>
|
||||
<p>Create, edit, and delete exercises</p>
|
||||
</header>
|
||||
<Route path="/" exact>
|
||||
<HomePage />
|
||||
<HomePage setExerciseToEdit={setExerciseToEdit} />
|
||||
</Route>
|
||||
<Route path="/create">
|
||||
<CreatePage />
|
||||
</Route>
|
||||
<Route path="/edit">
|
||||
<EditPage />
|
||||
<EditPage exerciseToEdit={exerciseToEdit} />
|
||||
</Route>
|
||||
</div>
|
||||
<nav>
|
||||
<div>
|
||||
<Link to="/">Home </Link>
|
||||
</div>
|
||||
<div>
|
||||
<Link to="/create">Create</Link>
|
||||
</div>
|
||||
</nav>
|
||||
<footer>© 2022 Andrew Scott</footer>
|
||||
</Router>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue