Skip to content

Commit

Permalink
feat :: 로그아웃 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
eejx0 committed Nov 6, 2024
1 parent e90df9a commit 7493cb8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions apps/company/src/components/modal/logout/logoutModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@ import React from "react";
import * as S from "./style";
import { Text, Button } from "@jobis/ui";
import { themes } from "@jobis/design-token";
import Link from "next/link";
import { useModal } from "@/hooks/useModal";
import { Cookies } from "react-cookie";

const LogoutModal = () => {
const { closeModal } = useModal();
const cookies = new Cookies();

const handleLogout = () => {
cookies.remove("access_token");
cookies.remove("refresh_token");

window.location.href = "/";

closeModal();
};
return (
<S.Container>
<S.TextWrapper>
Expand All @@ -31,7 +41,12 @@ const LogoutModal = () => {
>
취소
</Button>
<Button style={{ width: "112px", height: "48px" }}>확인</Button>
<Button
onClick={handleLogout}
style={{ width: "112px", height: "48px" }}
>
확인
</Button>
</S.ButtonWrapper>
</S.Container>
);
Expand Down

0 comments on commit 7493cb8

Please sign in to comment.