hamburger close on footer item click

This commit is contained in:
Owen Rees
2023-11-27 11:17:56 +01:00
parent bdc0c93a16
commit 3ae9632e40
2 changed files with 4 additions and 3 deletions
+4 -1
View File
@@ -5,10 +5,13 @@ import { FaGithub, FaRegEnvelope } from "react-icons/fa";
import { Link, usePathname } from "@/utils/navigation"; import { Link, usePathname } from "@/utils/navigation";
import { useSetAtom } from "jotai";
import { burgerMenuIsOpenAtom } from "@/atoms";
import ThemeSwitcher from "./ThemeSwitcher"; import ThemeSwitcher from "./ThemeSwitcher";
export default function Footer() { export default function Footer() {
const t = useTranslations("Footer"); const t = useTranslations("Footer");
const setBurgerMenuIsOpen = useSetAtom(burgerMenuIsOpenAtom);
const pathname = usePathname(); const pathname = usePathname();
return ( return (
@@ -16,7 +19,7 @@ export default function Footer() {
className="fixed bottom-0 z-30 flex h-12 w-[100vw] flex-col items-center justify-center justify-items-center bg-primary-600 px-5 py-2 text-white dark:bg-gray-700" className="fixed bottom-0 z-30 flex h-12 w-[100vw] flex-col items-center justify-center justify-items-center bg-primary-600 px-5 py-2 text-white dark:bg-gray-700"
data-test="footer" data-test="footer"
> >
<div className="flex items-center py-2 hover:[&_a]:opacity-80"> <div className="flex items-center py-2 hover:[&_a]:opacity-80" onClick={() => setBurgerMenuIsOpen(false)}>
<a <a
href="https://github.com/TheRealOwenRees/echecsfrance" href="https://github.com/TheRealOwenRees/echecsfrance"
target="_blank" target="_blank"
@@ -1,5 +1,3 @@
import { Dispatch, RefObject, SetStateAction, useRef, useState } from "react";
import { useAtom } from "jotai"; import { useAtom } from "jotai";
import { useTranslations } from "next-intl"; import { useTranslations } from "next-intl";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";