-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
111 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import * as S from "./style"; | ||
import { Text, Button } from "@jobis/ui"; | ||
import { themes } from "@jobis/design-token"; | ||
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> | ||
<Text fontSize="body1" fontWeight="bold"> | ||
로그아웃 | ||
</Text> | ||
<Text | ||
fontSize="body2" | ||
fontWeight="regular" | ||
color={themes.Color.grayScale[60]} | ||
> | ||
로그아웃 시 다음 접속 때 로그인 해야합니다. | ||
</Text> | ||
</S.TextWrapper> | ||
<S.ButtonWrapper> | ||
<Button | ||
onClick={closeModal} | ||
style={{ width: "112px", height: "48px" }} | ||
variant="outline" | ||
> | ||
취소 | ||
</Button> | ||
<Button | ||
onClick={handleLogout} | ||
style={{ width: "112px", height: "48px" }} | ||
> | ||
확인 | ||
</Button> | ||
</S.ButtonWrapper> | ||
</S.Container> | ||
); | ||
}; | ||
|
||
export default LogoutModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 203px; | ||
padding: 24px; | ||
border-radius: 8px; | ||
background-color: white; | ||
`; | ||
|
||
export const TextWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
`; | ||
|
||
export const ButtonWrapper = styled.div` | ||
display: flex; | ||
margin-top: 32px; | ||
gap: 8px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters