From 765606bac5eff813fa762d93ac2500a355e20cbd Mon Sep 17 00:00:00 2001 From: Sol Irvine Date: Sat, 19 Aug 2023 16:01:05 +0900 Subject: [PATCH] wip: More nav improvements --- components/layout/footer.tsx | 4 ++-- components/layout/menu/modal.tsx | 10 +++++++-- components/layout/navbar/index.tsx | 35 ++++++++++++++++++------------ 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/components/layout/footer.tsx b/components/layout/footer.tsx index f7413c1a5..e8d6c7aea 100644 --- a/components/layout/footer.tsx +++ b/components/layout/footer.tsx @@ -51,10 +51,10 @@ export default async function Footer({ cart }: { cart?: Cart }) {
- + - +
diff --git a/components/layout/menu/modal.tsx b/components/layout/menu/modal.tsx index 79d2b51cd..c60200a55 100644 --- a/components/layout/menu/modal.tsx +++ b/components/layout/menu/modal.tsx @@ -1,6 +1,7 @@ 'use client'; import { Dialog, Transition } from '@headlessui/react'; +import clsx from 'clsx'; import CloseIcon from 'components/icons/close'; import MenuIcon from 'components/icons/menu'; import { useLocale, useTranslations } from 'next-intl'; @@ -8,7 +9,7 @@ import Link from 'next/link'; import { Fragment, useRef, useState } from 'react'; import { LanguageControl, SupportedLocale } from '../navbar/language-control'; -export function MenuModal() { +export function MenuModal({ scrolled }: { scrolled: boolean }) { const t = useTranslations('Index'); const locale = useLocale(); let [isOpen, setIsOpen] = useState(false); @@ -56,7 +57,12 @@ export function MenuModal() { >
-
+
diff --git a/components/layout/navbar/index.tsx b/components/layout/navbar/index.tsx index a7870bdf0..f45df36e7 100644 --- a/components/layout/navbar/index.tsx +++ b/components/layout/navbar/index.tsx @@ -1,5 +1,6 @@ 'use client'; +import { Transition } from '@headlessui/react'; import clsx from 'clsx'; import CartModal from 'components/cart/modal'; import OpenCart from 'components/cart/open-cart'; @@ -18,25 +19,31 @@ export default function Navbar({ cart, locale }: { cart?: Cart; locale?: Support return (
- {!!ref && !inView && ( -
-
-
- +
+ +
+
+
-
-
- )} + +
@@ -44,16 +51,16 @@ export default function Navbar({ cart, locale }: { cart?: Cart; locale?: Support
-