Skip to content

Commit

Permalink
[TM-1488] add sign out functionality to dashboard side bar (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarLima1 authored Nov 20, 2024
1 parent 6d004be commit 3cd919e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/generic/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -81,8 +86,8 @@ const Sidebar = () => {
{
id: "1",
render: () => (
<Text variant="text-14" className="flex items-center">
{t("Sign out")}
<Text variant="text-14" className="flex cursor-pointer items-center" onClick={logout}>
{isLoggedIn ? t("Sign out") : t("Sign in")}
</Text>
)
}
Expand Down

0 comments on commit 3cd919e

Please sign in to comment.