Added header, footer, and nav

This commit is contained in:
Andrew Scott 2022-06-04 03:18:04 -04:00
parent ff73caab92
commit 67f3a70130
Signed by: a
GPG key ID: 3EB62D0BBB8DB381

View file

@ -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>
);