From 3cd919eb7c50197f30809df57356752b01dff9b3 Mon Sep 17 00:00:00 2001 From: cesarLima1 <105736261+cesarLima1@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:09:09 -0400 Subject: [PATCH] [TM-1488] add sign out functionality to dashboard side bar (#688) --- src/components/generic/Sidebar/Sidebar.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/generic/Sidebar/Sidebar.tsx b/src/components/generic/Sidebar/Sidebar.tsx index 2c5b336c6..885ca1d44 100644 --- a/src/components/generic/Sidebar/Sidebar.tsx +++ b/src/components/generic/Sidebar/Sidebar.tsx @@ -8,9 +8,14 @@ import { MENU_PLACEMENT_RIGHT_TOP } from "@/components/elements/Menu/MenuVariant import Text from "@/components/elements/Text/Text"; import Tooltip from "@/components/elements/Tooltip/Tooltip"; import Icon, { IconNames } from "@/components/extensive/Icon/Icon"; +import { useLogin } from "@/connections/Login"; +import { useLogout } from "@/hooks/logout"; const Sidebar = () => { const router = useRouter(); + const logout = useLogout(); + const [, { isLoggedIn }] = useLogin(); + const t = useT(); return ( @@ -81,8 +86,8 @@ const Sidebar = () => { { id: "1", render: () => ( - - {t("Sign out")} + + {isLoggedIn ? t("Sign out") : t("Sign in")} ) }