Skip to content

Commit

Permalink
Merge pull request #17 from the-collab-lab/ap-dg-navlink-routing
Browse files Browse the repository at this point in the history
Added NavLink routing to layout.
  • Loading branch information
andiedoescode authored Feb 7, 2024
2 parents 920970f + 8cf6c70 commit 3f77707
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 './Layout.css';
import { auth } from '../api/config.js';
import { useAuth, SignInButton, SignOutButton } from '../api/useAuth.jsx';

/**
* 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();
return (
Expand All @@ -33,15 +25,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 3f77707

Please sign in to comment.