From 16dc6b59b31b3a7dfaff290991faa86648c5cda3 Mon Sep 17 00:00:00 2001 From: Wenderson Pires Date: Fri, 7 Jun 2024 11:37:00 -0300 Subject: [PATCH 1/2] Mobile view; Cart button; Cart notification --- src/app/_layout/Nav.tsx | 204 +++++++++++++++++++--------- src/common/ui/components/button.tsx | 1 + 2 files changed, 140 insertions(+), 65 deletions(-) diff --git a/src/app/_layout/Nav.tsx b/src/app/_layout/Nav.tsx index 4d344eac..6c46a1b4 100644 --- a/src/app/_layout/Nav.tsx +++ b/src/app/_layout/Nav.tsx @@ -1,6 +1,6 @@ "use client"; -import { useCallback } from "react"; +import { useCallback, useState } from "react"; import Image from "next/image"; import Link from "next/link"; @@ -14,6 +14,25 @@ import routesPath from "@/modules/core/routes"; import UserDropdown from "../_components/UserDropdown"; +const tabOptions = [ + { + text: "Projects", + link: routesPath.PROJECTS_LIST, + disabled: false, + }, + { text: "Feed", link: "feed", disabled: false }, + { + text: "Pots", + link: routesPath.POTS, + disabled: false, + }, + { + text: "Donors", + link: routesPath.DONORS, + disabled: false, + }, +]; + const AuthButton = () => { const { isAuthenticated } = useAuth(); const isClient = useIsClient(); @@ -25,93 +44,148 @@ const AuthButton = () => { if (!isClient) return; if (isAuthenticated) { - return ( - - // - ); + return ; } return ( ); }; -const Nav = () => { +const MobileMenuButton = ({ onClick }: { onClick: () => void }) => { + return ( + + ); +}; + +const MobileNav = () => { const isClient = useIsClient(); const pathname = usePathname(); - const tabOptions = [ - { - text: "Projects", - link: routesPath.PROJECTS_LIST, - disabled: false, - }, - { text: "Feed", link: "feed", disabled: false }, - { - text: "Pots", - link: routesPath.POTS, - disabled: false, - }, - { - text: "Donors", - link: routesPath.DONORS, - disabled: false, - }, - ]; - return ( - + {/* Mobile Nav */} +
{showMobileMenu && }
+ ); }; diff --git a/src/common/ui/components/button.tsx b/src/common/ui/components/button.tsx index 4dc39444..bfd3c14f 100644 --- a/src/common/ui/components/button.tsx +++ b/src/common/ui/components/button.tsx @@ -39,6 +39,7 @@ const buttonVariants = cva( font: { default: "font-medium", bold: "font-bold", + semibold: "font-semibold", }, }, defaultVariants: { From 027752b4396d36fe9c65c6a87d2d7b72a41fadf9 Mon Sep 17 00:00:00 2001 From: Wenderson Pires Date: Fri, 7 Jun 2024 11:41:29 -0300 Subject: [PATCH 2/2] remove mobile menu button outline --- src/app/_layout/Nav.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/_layout/Nav.tsx b/src/app/_layout/Nav.tsx index 6c46a1b4..88885f3e 100644 --- a/src/app/_layout/Nav.tsx +++ b/src/app/_layout/Nav.tsx @@ -63,7 +63,7 @@ const MobileMenuButton = ({ onClick }: { onClick: () => void }) => { return (