-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [55] 마이페이지, 회원탈퇴 구현 #56
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,37 @@ | ||
import { ComponentProps } from 'react'; | ||
import { ComponentProps, useEffect, useState } from 'react'; | ||
import { HeaderWrapper } from './header.styles'; | ||
import styled from 'styled-components'; | ||
import btnMypage from '@/assets/btn_mypage.png'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
type HeaderProps = ComponentProps<'header'>; | ||
|
||
export const Header = ({ children }: HeaderProps) => { | ||
return <HeaderWrapper>{children}</HeaderWrapper>; | ||
const [isLoggedIn, setIsLoggedIn] = useState(false); | ||
const navigate = useNavigate(); | ||
|
||
useEffect(() => { | ||
const token = localStorage.getItem('token'); | ||
if (token) { | ||
setIsLoggedIn(true); | ||
} | ||
}, []); | ||
|
||
const moveMyPage = () => { | ||
navigate('/mypage'); | ||
}; | ||
|
||
return ( | ||
<HeaderWrapper> | ||
{children} | ||
{isLoggedIn && ( | ||
<MypageIcon src={btnMypage} alt="My Page" onClick={moveMyPage} /> | ||
)} | ||
</HeaderWrapper> | ||
); | ||
}; | ||
|
||
const MypageIcon = styled.img` | ||
width: 38px; | ||
cursor: pointer; | ||
`; |
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,15 @@ | ||
import { useDeleteUser } from '@/services/queries/user.mutation'; | ||
|
||
export const DeleteModal = () => { | ||
const { deleteUserAccount, isDeleting } = useDeleteUser(); | ||
|
||
const handleDelete = () => { | ||
deleteUserAccount().then(() => onClose()); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div>탈퇴</div> | ||
</> | ||
); | ||
}; |
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,28 @@ | ||
import { body1Style } from '@/styles/global-styles'; | ||
import { COLORS } from '@/theme'; | ||
import styled from 'styled-components'; | ||
|
||
export const Information = styled.div` | ||
${body1Style} | ||
color: ${COLORS.Gray1}; | ||
border-bottom: 1px solid ${COLORS.Gray5}; | ||
padding: 30px 0px 30px 0px; | ||
`; | ||
|
||
export const BasicInfo = styled.div` | ||
margin-bottom: 20px; | ||
`; | ||
|
||
export const InfoContainer = styled.div` | ||
display: flex; | ||
gap: 27px; | ||
`; | ||
export const Info = styled.p` | ||
${body1Style} | ||
color: ${COLORS.Gray2}; | ||
`; | ||
|
||
export const Id = styled.a` | ||
color: ${COLORS.Gray2}; | ||
text-decoration: none; | ||
`; |
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,28 @@ | ||
import { UserInfoType } from '@/types/user'; | ||
import { | ||
BasicInfo, | ||
Id, | ||
Info, | ||
InfoContainer, | ||
Information, | ||
} from './user-info.styles'; | ||
|
||
export const UserInfo = ({ user }: { user: UserInfoType }) => { | ||
return ( | ||
<Information> | ||
<BasicInfo>기본 정보</BasicInfo> | ||
<InfoContainer> | ||
<Info>아이디</Info> | ||
<Id>{user.userId}</Id> | ||
</InfoContainer> | ||
<InfoContainer> | ||
<Info>휴대폰</Info> | ||
<Id>{user.phoneNumber}</Id> | ||
</InfoContainer> | ||
<InfoContainer> | ||
<Info>이메일</Info> | ||
<Id>{user.email}</Id> | ||
</InfoContainer> | ||
</Information> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { createQueryKeyStore } from '@lukemorales/query-key-factory'; | ||
const USER = 'user'; | ||
|
||
export const queries = createQueryKeyStore({ | ||
export const queries = { | ||
user: { | ||
all: null, | ||
DEFAULT: [USER], | ||
}, | ||
}); | ||
}; |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2개는 무슨 차이인가용?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
처음에는 퀴리키 생성 라이브러리를 사용하려했는데, 저희가 복잡한 퀴리를 다루지 않을것같아서 직접 구현하였습니다!