-
Notifications
You must be signed in to change notification settings - Fork 20
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: 회원가입 시 유저명과 프로필 이모지를 입력받도록 폼 수정 #880
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8e1a497
feat: 회원가입 시 이름을 입력받도록 폼 수정
Puterism 3fea656
feat: 회원가입 폼에 프로필 이모지를 선택할 수 있는 기능 추가 및 조직명 입력 삭제
Puterism ef7c2b1
feat: 소셜 회원가입 폼에 프로필 이모지를 선택할 수 있는 기능 추가 및 조직명 입력 삭제
Puterism 8736f41
refactor: 코드리뷰에 따른 리팩토링
Puterism c355196
refactor: 코드리뷰에 따른 리팩토링
Puterism 4a8940b
refactor: 이메일 및 이름 중복 확인 API URL 변경 대응
Puterism 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { AxiosError, AxiosResponse } from 'axios'; | ||
import { QueryKey, useQuery, UseQueryOptions, UseQueryResult } from 'react-query'; | ||
import { getEmojiList } from 'api/join'; | ||
import { QueryEmojiListSuccess } from 'types/response'; | ||
|
||
const useEmojiList = <TData = AxiosResponse<QueryEmojiListSuccess>>( | ||
options?: UseQueryOptions<AxiosResponse<QueryEmojiListSuccess>, AxiosError, TData, [QueryKey]> | ||
): UseQueryResult<TData, AxiosError> => | ||
useQuery(['getEmojiList'], getEmojiList, { | ||
...options, | ||
refetchOnWindowFocus: false, | ||
}); | ||
|
||
export default useEmojiList; |
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
78 changes: 78 additions & 0 deletions
78
frontend/src/pages/ManagerJoin/units/EmojiSelector.styles.ts
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,78 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const EmojiSelector = styled.div` | ||
position: relative; | ||
padding: 0.75rem; | ||
margin-top: 0.5rem; | ||
margin-bottom: 2rem; | ||
width: 100%; | ||
border-top: 1px solid ${({ theme }) => theme.gray[500]}; | ||
background: none; | ||
outline: none; | ||
display: flex; | ||
justify-content: center; | ||
`; | ||
|
||
export const LabelText = styled.span` | ||
position: absolute; | ||
display: inline-block; | ||
top: -0.375rem; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
padding: 0 0.25rem; | ||
font-size: 0.75rem; | ||
background-color: white; | ||
color: ${({ theme }) => theme.gray[500]}; | ||
`; | ||
|
||
export const EmojiList = styled.div` | ||
margin-top: 1rem; | ||
font-size: 2.5rem; | ||
display: grid; | ||
grid-template-rows: repeat(2, 4rem); | ||
grid-template-columns: repeat(5, 4rem); | ||
gap: 1.25rem; | ||
|
||
@media (max-width: ${({ theme: { breakpoints } }) => breakpoints.sm}px) { | ||
font-size: 1.5rem; | ||
grid-template-rows: repeat(2, 3rem); | ||
grid-template-columns: repeat(5, 3rem); | ||
gap: 0.5rem; | ||
} | ||
`; | ||
|
||
export const EmojiItem = styled.label` | ||
position: relative; | ||
margin-bottom: 0; | ||
justify-self: center; | ||
align-self: center; | ||
`; | ||
|
||
export const EmojiCode = styled.div` | ||
cursor: pointer; | ||
border-radius: 999px; | ||
width: 4rem; | ||
height: 4rem; | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: ${({ theme }) => theme.gray[100]}; | ||
|
||
input:checked + & { | ||
background-color: ${({ theme }) => theme.primary[400]}; | ||
} | ||
|
||
@media (max-width: ${({ theme: { breakpoints } }) => breakpoints.sm}px) { | ||
width: 3rem; | ||
height: 3rem; | ||
} | ||
`; | ||
|
||
export const Radio = styled.input` | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 0; | ||
height: 0; | ||
visibility: hidden; | ||
`; |
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,41 @@ | ||
import { useMemo } from 'react'; | ||
import useEmojiList from 'hooks/query/useEmojiList'; | ||
import * as Styled from './EmojiSelector.styles'; | ||
|
||
interface EmojiSelectorProps { | ||
onSelect?: (emoji: string) => void; | ||
} | ||
|
||
const EmojiSelector = ({ onSelect }: EmojiSelectorProps): JSX.Element => { | ||
const emojiListQuery = useEmojiList(); | ||
|
||
const emojiList = useMemo( | ||
() => emojiListQuery.data?.data.emojis ?? [], | ||
[emojiListQuery.data?.data.emojis] | ||
); | ||
|
||
const handleSelect = (emoji: string) => { | ||
onSelect?.(emoji); | ||
}; | ||
|
||
return ( | ||
<Styled.EmojiSelector> | ||
<Styled.LabelText>프로필 이모지 선택</Styled.LabelText> | ||
<Styled.EmojiList> | ||
{emojiList.map((emoji) => ( | ||
<Styled.EmojiItem key={emoji.name}> | ||
<Styled.Radio | ||
type="radio" | ||
name="emoji" | ||
id={emoji.name} | ||
onChange={() => handleSelect(emoji.name)} | ||
/> | ||
<Styled.EmojiCode>{emoji.code}</Styled.EmojiCode> | ||
</Styled.EmojiItem> | ||
))} | ||
</Styled.EmojiList> | ||
</Styled.EmojiSelector> | ||
); | ||
}; | ||
|
||
export default EmojiSelector; |
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.
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.
해당 쿼리에
refetchOnWindowFocus
를false
로 주신 이유가 있을까용?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.
이모지 리스트는 실시간으로 데이터를 업데이트할 필요가 없다고 생각해서 반복적으로 fetch해오는 상황을 막아주고 싶었습니다.