We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23b7fd5 commit 1567be4Copy full SHA for 1567be4
components/organisms/Header/navigation/Vertical/index.tsx
@@ -23,7 +23,7 @@ const NavigationVertical: FunctionComponent<NavigationProps> = ({
23
}) => {
24
const [open, setOpen] = useState(false);
25
const [active, setActive] = useState<string | null>(null);
26
- const { setPinned } = useHeadroom();
+ const { pinned, setPinned } = useHeadroom();
27
28
const handleOpenToggle = () => {
29
if (open) {
@@ -36,7 +36,12 @@ const NavigationVertical: FunctionComponent<NavigationProps> = ({
36
};
37
38
function handleToggleClick(id: string) {
39
- setActive((prevActive) => (prevActive === id ? null : id));
+ if (active === id) {
40
+ setActive(null);
41
+ } else {
42
+ setPinned(true);
43
+ setActive(id);
44
+ }
45
}
46
47
return (
0 commit comments