diff --git a/components/organisms/Header/navigation/Vertical/index.tsx b/components/organisms/Header/navigation/Vertical/index.tsx index f0a27f9b..57c8d8e5 100644 --- a/components/organisms/Header/navigation/Vertical/index.tsx +++ b/components/organisms/Header/navigation/Vertical/index.tsx @@ -23,7 +23,7 @@ const NavigationVertical: FunctionComponent = ({ }) => { const [open, setOpen] = useState(false); const [active, setActive] = useState(null); - const { setPinned } = useHeadroom(); + const { pinned, setPinned } = useHeadroom(); const handleOpenToggle = () => { if (open) { @@ -36,7 +36,12 @@ const NavigationVertical: FunctionComponent = ({ }; function handleToggleClick(id: string) { - setActive((prevActive) => (prevActive === id ? null : id)); + if (active === id) { + setActive(null); + } else { + setPinned(true); + setActive(id); + } } return (