From cea028f5b29711fa711d3088af244322457d60e6 Mon Sep 17 00:00:00 2001 From: John Doe Date: Sat, 9 Sep 2023 17:40:30 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Implemented=20NavMobile?= =?UTF-8?q?=20component=20=F0=9F=9A=A7=20Added=20the=20NavMobile=20compone?= =?UTF-8?q?nt=20to=20the=20project=20=F0=9F=94=97=20Linked=20NavMobile=20t?= =?UTF-8?q?o=20NavigationItem=20=E2=9C=A8=20Improved=20mobile=20navigation?= =?UTF-8?q?=20experience=20=F0=9F=90=9B=20Fixed=20minor=20styling=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/Navigation/NavMobile.tsx | 149 ++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 src/shared/Navigation/NavMobile.tsx diff --git a/src/shared/Navigation/NavMobile.tsx b/src/shared/Navigation/NavMobile.tsx new file mode 100644 index 0000000..2794194 --- /dev/null +++ b/src/shared/Navigation/NavMobile.tsx @@ -0,0 +1,149 @@ +"use client"; + +import React from "react"; +import ButtonClose from "@/shared/ButtonClose"; +import Logo from "@/shared/Logo"; +import { Disclosure } from "@headlessui/react"; +import { NavItemType } from "./NavigationItem"; +import { NAVIGATION_DEMO } from "@/data/navigation"; +import ButtonPrimary from "@/shared/ButtonPrimary"; +import SocialsList from "@/shared/SocialsList"; +import { ChevronDownIcon } from "@heroicons/react/24/solid"; +import SwitchDarkMode from "@/shared/SwitchDarkMode"; +import Link from "next/link"; +import LangDropdown from "@/app/(client-components)/(Header)/LangDropdown"; + +export interface NavMobileProps { + data?: NavItemType[]; + onClickClose?: () => void; +} + +const NavMobile: React.FC = ({ + data = NAVIGATION_DEMO, + onClickClose, +}) => { + const _renderMenuChild = (item: NavItemType) => { + return ( + + ); + }; + + const _renderItem = (item: NavItemType, index: number) => { + return ( + + + + {item.name} + + {item.children && ( + e.preventDefault()}> + + + + )} + + {item.children && ( + {_renderMenuChild(item)} + )} + + ); + }; + + return ( +
+
+ +
+ + Discover the most outstanding articles on all topics of life. Write + your stories and share them + + +
+ + + + +
+
+ + + +
+
    + {data.map(_renderItem)} +
+
+ + Get Template + + + +
+
+ ); +}; + +export default NavMobile;