From 1a7323a3ffeeb08b87d664f100bae3b7c08dc13e Mon Sep 17 00:00:00 2001 From: mckervinc Date: Mon, 17 Jun 2024 23:27:39 -0400 Subject: [PATCH] fix mobile nav --- example/src/components/Layout.tsx | 6 +++--- example/src/components/Navigation.tsx | 12 +++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/example/src/components/Layout.tsx b/example/src/components/Layout.tsx index 86fed8c..52c433e 100644 --- a/example/src/components/Layout.tsx +++ b/example/src/components/Layout.tsx @@ -1,4 +1,4 @@ -import Navigation from "@/components/Navigation"; +import MobileNav from "@/components/Navigation"; import { Snippet } from "@/components/Snippet"; import { faGithubAlt } from "@fortawesome/free-brands-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; @@ -77,11 +77,11 @@ const Layout = () => { {links} {/* Mobile Nav */} - +
{links}
-
+ {/* Content */}
{!!title && ( diff --git a/example/src/components/Navigation.tsx b/example/src/components/Navigation.tsx index a605143..34190ad 100644 --- a/example/src/components/Navigation.tsx +++ b/example/src/components/Navigation.tsx @@ -1,9 +1,10 @@ +import { cn } from "@/lib/utils"; import { faBars, faTimes } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import React, { useEffect, useRef, useState } from "react"; import { useLocation } from "react-router-dom"; -const Navigation = ({ children }: { children?: React.ReactNode }) => { +const MobileNav = ({ children }: { children?: React.ReactNode }) => { // hooks const [isOpen, setIsOpen] = useState(false); const { pathname } = useLocation(); @@ -23,7 +24,12 @@ const Navigation = ({ children }: { children?: React.ReactNode }) => { }, [isOpen]); return ( -