-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[탈퇴뷰] 레이아웃 구조 변경
- Loading branch information
Showing
8 changed files
with
67 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import styled from 'styled-components'; | ||
import { useDeleteUser } from '../hooks/queries/useDeleteUser'; | ||
|
||
interface DeleteButtonInterface { | ||
message: string; | ||
} | ||
|
||
const DeleteButton = ({ message }: DeleteButtonInterface) => { | ||
const { deleteUser } = useDeleteUser(); | ||
const accessToken = localStorage.getItem('ACCESS_TOKEN'); | ||
|
||
if (!accessToken) { | ||
console.error('Access token is missing'); | ||
return null; | ||
} | ||
|
||
const handleDeleteUser = () => { | ||
deleteUser(accessToken); | ||
}; | ||
|
||
return <ButtonWrapper onClick={handleDeleteUser}>{message}</ButtonWrapper>; | ||
}; | ||
|
||
export default DeleteButton; | ||
|
||
const ButtonWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 26rem; | ||
height: 5.2rem; | ||
font-size: 1.6rem; | ||
text-align: center; | ||
color: ${({ theme }) => theme.colors.red}; | ||
border-radius: 1.8rem; | ||
border: 1px solid ${({ theme }) => theme.colors.red}; | ||
`; |
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
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