Skip to content

Commit

Permalink
Update container_page.tsx
Browse files Browse the repository at this point in the history
Fixed bug of categories navbar
  • Loading branch information
JohanMejia77 authored Oct 3, 2023
1 parent 83a7aad commit 620bad7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/container_page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use client'
import Footer from '~/components/footer/Footer';
import NavBar from '~/components/navBar/navBar';
import Categories from '~/components/categories/categories';
import { usePathname } from 'next/navigation';

type ContainerPageProps = {
children: React.ReactNode;
Expand All @@ -15,12 +17,13 @@ export function ContainerPage({
footer = true,
children,
}: ContainerPageProps) {
const pathname = usePathname();
return (
<>
{typeof nav === 'boolean' && nav ? <NavBar /> : nav}
{header && header}
<main className="min-h-screen overflow-hidden mx-auto">
<Categories/>
{pathname !== '/' && <Categories />}
{children}
</main>
{footer && <Footer />}
Expand Down

0 comments on commit 620bad7

Please sign in to comment.