From 8752e6b80d34a636859d5fdbdfed4e3efdbb6f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Or=C5=82=C3=B3w?= <adrian.orlow@fishbrain.com> Date: Wed, 10 Jan 2024 12:25:57 +0100 Subject: [PATCH] fix: add open modal login on login button click --- src/components/FunctionalArea/NavBar/NavBar.component.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/FunctionalArea/NavBar/NavBar.component.tsx b/src/components/FunctionalArea/NavBar/NavBar.component.tsx index 29ce0fb0..fbc5c000 100644 --- a/src/components/FunctionalArea/NavBar/NavBar.component.tsx +++ b/src/components/FunctionalArea/NavBar/NavBar.component.tsx @@ -3,6 +3,7 @@ import luxembourgLogoImg from '@/assets/images/luxembourg-logo.png'; import { openDrawer } from '@/redux/drawer/drawer.slice'; import { useAppDispatch } from '@/redux/hooks/useAppDispatch'; import { openLegend } from '@/redux/legend/legend.slice'; +import { openLoginModal } from '@/redux/modal/modal.slice'; import { IconButton } from '@/shared/IconButton'; import Image from 'next/image'; @@ -25,6 +26,10 @@ export const NavBar = (): JSX.Element => { dispatch(openLegend()); }; + const openModalLogin = (): void => { + dispatch(openLoginModal()); + }; + return ( <div className="flex min-h-full w-[88px] flex-col items-center justify-between bg-cultured py-8"> <div data-testid="nav-buttons"> @@ -35,7 +40,7 @@ export const NavBar = (): JSX.Element => { <IconButton icon="export" onClick={openDrawerExport} /> </div> <div className="flex flex-col gap-[10px]"> - <IconButton icon="admin" /> + <IconButton icon="admin" onClick={openModalLogin} /> <IconButton icon="legend" onClick={openDrawerLegend} /> </div> </div> -- GitLab