100devs / course-tracker

A course-tracker for 100Devs
26 stars 9 forks source link

Task - Lift up common components in to an AppWrapper (Frontend)Probably should then have two different layout wrappers, #121

Closed indifferentghost closed 2 years ago

indifferentghost commented 2 years ago

Common page elements like NavBar and footer should be lifted into a common wrapper.

Probably should then have two different layout wrappers,

const excludeNav = [
  '/login'
];
function Layout({ children }) {
  const { pathname } = useLocation();
  if (excludeNav.includes(pathname)) {
    return <>{children}<Footer /></>;
  }
  return <><Navbar/>{children}<Footer/></>
}

_Originally posted by @indifferentghost in https://github.com/100devs/course-tracker/pull/116#discussion_r749631492_