remove footer navigation from cart
This commit is contained in:
@@ -8,6 +8,7 @@ import useToggle from '@/hooks/helpers/useToggle';
|
|||||||
import { usePathname, useRouter } from 'next/navigation';
|
import { usePathname, useRouter } from 'next/navigation';
|
||||||
import usePreference from '@/hooks/helpers/usePreference';
|
import usePreference from '@/hooks/helpers/usePreference';
|
||||||
import PagerModal from '../pager/PagerModal';
|
import PagerModal from '../pager/PagerModal';
|
||||||
|
import clsx from 'clsx';
|
||||||
|
|
||||||
type Props = {} & React.AllHTMLAttributes<HTMLBodyElementEventMap>
|
type Props = {} & React.AllHTMLAttributes<HTMLBodyElementEventMap>
|
||||||
|
|
||||||
@@ -41,6 +42,7 @@ function ClientMenuRouteWrapper({ children }: Props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const location = usePathname();
|
const location = usePathname();
|
||||||
|
const hideBottomNav = pathname.endsWith('/cart');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (menuState) {
|
if (menuState) {
|
||||||
@@ -66,9 +68,11 @@ function ClientMenuRouteWrapper({ children }: Props) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{!hideBottomNav && (
|
||||||
<div className="fixed bottom-0 left-0 right-0 z-45 px-4">
|
<div className="fixed bottom-0 left-0 right-0 z-45 px-4">
|
||||||
<BottomNavBar onPagerClick={togglePager} />
|
<BottomNavBar onPagerClick={togglePager} />
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
|
||||||
<SideMenu
|
<SideMenu
|
||||||
@@ -80,7 +84,10 @@ function ClientMenuRouteWrapper({ children }: Props) {
|
|||||||
|
|
||||||
|
|
||||||
<main
|
<main
|
||||||
className="relative noscrollbar overflow-y-auto h-svh pt-6 xl:pt-8 pb-12 px-4 xl:pr-0 xl:pl-5 w-full xl:w-[calc(100%-285px)] md:self-end"
|
className={clsx(
|
||||||
|
'relative noscrollbar overflow-y-auto h-svh pt-6 xl:pt-8 px-4 xl:pr-0 xl:pl-5 w-full xl:w-[calc(100%-285px)] md:self-end',
|
||||||
|
hideBottomNav ? 'pb-4' : 'pb-12',
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
Reference in New Issue
Block a user