Skip to content

Commit

Permalink
Close manu when navigating
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroschmitz committed Oct 27, 2024
1 parent 70e69fa commit eaa1457
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ export default function Homepage() {
</div>

<footer className="bg-white">
<div className="mx-auto max-w-7xl px-6 py-12 text-center lg:px-8">
<p className="mt-8 text-center text-sm/6 text-gray-600 md:order-1 md:mt-0">
<div className="mx-auto max-w-7xl px-6 pb-12 text-center lg:px-8">
<p className="text-center text-sm/6 text-gray-600 md:order-1">
&copy; {new Date().getFullYear()} Created with ❤️ by{' '}
<Link href="https://joaopedro.dev">João Pedro Schmitz</Link>
</p>
Expand Down
8 changes: 7 additions & 1 deletion src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import { Dialog, DialogPanel } from '@headlessui/react';
import { Bars3Icon } from '@heroicons/react/24/outline';
import { XMarkIcon } from '@heroicons/react/24/solid';
import { useState } from 'react';
import { useParams } from 'next/navigation';
import { useEffect, useState } from 'react';

import { Link } from '@/lib/ui/link';

Expand All @@ -14,8 +15,13 @@ const navigation = [
];

export function Header() {
const params = useParams();
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);

useEffect(() => {
setMobileMenuOpen(false);
}, [params]);

return (
<header className="absolute inset-x-0 top-0 z-50">
<nav aria-label="Global" className="mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8">
Expand Down

0 comments on commit eaa1457

Please sign in to comment.