From 1c535e92dab5b7c799d83e8b2424bf1cba5c4cf3 Mon Sep 17 00:00:00 2001 From: ArtemkaDev Date: Fri, 14 Jun 2024 12:49:24 +0300 Subject: [PATCH] fix --- .../navigation/MobileNavigation.tsx | 76 ++++++++++++++----- 1 file changed, 55 insertions(+), 21 deletions(-) diff --git a/src/components/navigation/MobileNavigation.tsx b/src/components/navigation/MobileNavigation.tsx index 5041cdc..e9cb630 100644 --- a/src/components/navigation/MobileNavigation.tsx +++ b/src/components/navigation/MobileNavigation.tsx @@ -4,6 +4,8 @@ import LanguageSwitcher from "../language/LanguageSwitcher"; import Image from "next/image"; import { Murecho } from "next/font/google"; import { useTranslations } from "next-intl"; +import { usePathname } from "next/navigation"; +import Link from "next/link"; const murecho = Murecho({ subsets: ["latin", "cyrillic"] }); @@ -13,13 +15,21 @@ export default function MobileNavigation() { const [mainComponentHeight, setMainComponentHeight] = useState(0); const mainComponentRef = useRef(null); + const pathname = usePathname(); + const lang = pathname.substring(1, 3); + function toggle() { setShowMe(!showMe); } + function close() { + setTimeout(() => { + setShowMe(false); + }, 300); + } useEffect(() => { if (mainComponentRef.current) { - let component = mainComponentRef.current as any + let component = mainComponentRef.current as any; setMainComponentHeight(component.offsetHeight); } }, []); @@ -30,13 +40,15 @@ export default function MobileNavigation() { ref={mainComponentRef} className={`flex flex-column bg-white justify-between items-center ${styles.mainComponent}`} > - AploCoin logo + + AploCoin logo +