Skip to content

Commit

Permalink
Merge pull request #17 from the-collab-lab/jh-am-add-navlink
Browse files Browse the repository at this point in the history
[JH] [AM] Add NavLink
  • Loading branch information
hsiangj authored Feb 6, 2024
2 parents 922240e + aa40072 commit c6de869
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/views/Layout.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import { Outlet } from 'react-router-dom';
import { Outlet, NavLink } from 'react-router-dom';
import { useAuth, SignInButton, SignOutButton } from '../api/useAuth.jsx';

import './Layout.css';
import { auth } from '../api/config.js';

/**
* TODO: The links defined in this file don't work!
*
* Instead of anchor element, they should use a component
* from `react-router-dom` to navigate to the routes
* defined in `App.jsx`.
*/

export function Layout() {
const { user } = useAuth();

Expand All @@ -34,15 +26,15 @@ export function Layout() {
</main>
<nav className="Nav">
<div className="Nav-container">
<a href="#" className="Nav-link">
<NavLink to="/" className="Nav-link">
Home
</a>
<a href="#" className="Nav-link">
</NavLink>
<NavLink to="/list" className="Nav-link">
List
</a>
<a href="#" className="Nav-link">
</NavLink>
<NavLink to="/manage-list" className="Nav-link">
Manage List
</a>
</NavLink>
</div>
</nav>
</div>
Expand Down

0 comments on commit c6de869

Please sign in to comment.