-
Notifications
You must be signed in to change notification settings - Fork 4
Feat/markup/signup/DEVING-25 회원가입 페이지 개발 #25
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
Changes from 9 commits
15192a0
54440cb
92772d8
380ab9e
7f6bfc9
b95dd8d
c5f7eb2
94809a7
6778d13
9e7d588
801b035
787c2a8
442530f
c4d9a92
e4e3ac0
c1fdeb6
0dcbd56
303fb79
66d5593
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| 'use client'; | ||
|
|
||
| import Chip from '@/components/ui/Chip'; | ||
| import React, { useState } from 'react'; | ||
|
|
||
| export default function ChipPreview() { | ||
| const [position, setPosition] = useState(''); | ||
|
|
||
| return ( | ||
| <div className="flex flex-col gap-8 bg-gray-50 p-8 pb-32"> | ||
| <Chip>All</Chip> | ||
| <Chip isActive>All</Chip> | ||
| <div className="w-[544px] p-[40px]"> | ||
| <div className="flex w-full"> | ||
| <Chip | ||
| className={`flex-1 hover:cursor-pointer`} | ||
| isActive={position === 'Frontend'} | ||
| onClick={() => setPosition('Frontend')} | ||
| > | ||
| 프론트엔드 | ||
| </Chip> | ||
| <Chip | ||
| className={`flex-1 hover:cursor-pointer`} | ||
| isActive={position === 'Backend'} | ||
| onClick={() => setPosition('Backend')} | ||
| > | ||
| 백엔드 | ||
| </Chip> | ||
| <Chip | ||
| className={`flex-1 hover:cursor-pointer`} | ||
| isActive={position === 'Designer'} | ||
| onClick={() => setPosition('Designer')} | ||
| > | ||
| 디자이너 | ||
| </Chip> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import Chip from '@/components/ui/Chip'; | ||
|
|
||
| export const ChipContainer = ({ | ||
| position, | ||
| setPosition, | ||
| }: { | ||
| position: string; | ||
| setPosition: (value: string) => void; | ||
| }) => { | ||
| return ( | ||
| <div className="flex w-full gap-[8px]"> | ||
| <Chip | ||
| className={`flex-1 hover:cursor-pointer`} | ||
| isActive={position === 'Frontend'} | ||
| onClick={() => setPosition('Frontend')} | ||
| > | ||
| 프론트엔드 | ||
| </Chip> | ||
| <Chip | ||
| className={`flex-1 hover:cursor-pointer`} | ||
| isActive={position === 'Backend'} | ||
| onClick={() => setPosition('Backend')} | ||
| > | ||
| 백엔드 | ||
| </Chip> | ||
| <Chip | ||
| className={`flex-1 hover:cursor-pointer`} | ||
| isActive={position === 'Designer'} | ||
| onClick={() => setPosition('Designer')} | ||
| > | ||
| 디자이너 | ||
| </Chip> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요 Chip은 마이페이지 수정에서도 사용될 컴포넌트여서 추후 분리 요청가능할까용 |
||
| </div> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,164 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 'use client'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| import { Button } from '@/components/ui/Button'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import { Input } from '@/components/ui/Input'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import useSignUpForm from '@/hooks/useSignupForm'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||||||||||
| emailValidation, | ||||||||||||||||||||||||||||||||||||||||||||||||
| nameValidation, | ||||||||||||||||||||||||||||||||||||||||||||||||
| passwordCheckValidation, | ||||||||||||||||||||||||||||||||||||||||||||||||
| passwordValidation, | ||||||||||||||||||||||||||||||||||||||||||||||||
| positionValidation, | ||||||||||||||||||||||||||||||||||||||||||||||||
| } from '@/util/validation'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import Link from 'next/link'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| import { ChipContainer } from './ChipContainer'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const SignupForm = () => { | ||||||||||||||||||||||||||||||||||||||||||||||||
| const { | ||||||||||||||||||||||||||||||||||||||||||||||||
| handleSubmit, | ||||||||||||||||||||||||||||||||||||||||||||||||
| onSubmit, | ||||||||||||||||||||||||||||||||||||||||||||||||
| register, | ||||||||||||||||||||||||||||||||||||||||||||||||
| errors, | ||||||||||||||||||||||||||||||||||||||||||||||||
| isNameCheck, | ||||||||||||||||||||||||||||||||||||||||||||||||
| handleNameCheck, | ||||||||||||||||||||||||||||||||||||||||||||||||
| isEmailCheck, | ||||||||||||||||||||||||||||||||||||||||||||||||
| handleEmailCheck, | ||||||||||||||||||||||||||||||||||||||||||||||||
| watch, | ||||||||||||||||||||||||||||||||||||||||||||||||
| handleClickPosition, | ||||||||||||||||||||||||||||||||||||||||||||||||
| dirtyFields, | ||||||||||||||||||||||||||||||||||||||||||||||||
| setFocusedField, | ||||||||||||||||||||||||||||||||||||||||||||||||
| } = useSignUpForm(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||
| <form | ||||||||||||||||||||||||||||||||||||||||||||||||
| onSubmit={handleSubmit(onSubmit)} | ||||||||||||||||||||||||||||||||||||||||||||||||
| className="flex w-[544px] flex-col rounded-[16px] bg-BG_2 p-[40px]" | ||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+32
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 폼 제출 시 피드백이 필요합니다. 사용자에게 폼 제출 상태와 결과를 알려주어야 합니다. <form
onSubmit={handleSubmit(onSubmit)}
- className="flex w-[544px] flex-col rounded-[16px] bg-BG_2 p-[40px]"
+ className="flex w-[544px] flex-col rounded-[16px] bg-BG_2 p-[40px] relative"
>
+ {isSubmitting && (
+ <div className="absolute inset-0 bg-black/50 flex items-center justify-center rounded-[16px]">
+ <p className="text-white">가입 처리중...</p>
+ </div>
+ )}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
| <div> | ||||||||||||||||||||||||||||||||||||||||||||||||
| <h2 className="typo-head2 mb-[40px] text-center text-white"> | ||||||||||||||||||||||||||||||||||||||||||||||||
| 회원가입 | ||||||||||||||||||||||||||||||||||||||||||||||||
| </h2> | ||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="flex flex-col gap-[24px]"> | ||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="flex flex-col gap-[8px]"> | ||||||||||||||||||||||||||||||||||||||||||||||||
| <label htmlFor="name" className="typo-head3 text-Cgray700"> | ||||||||||||||||||||||||||||||||||||||||||||||||
| 닉네임 | ||||||||||||||||||||||||||||||||||||||||||||||||
| </label> | ||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="flex flex-row gap-[8px]"> | ||||||||||||||||||||||||||||||||||||||||||||||||
| <Input | ||||||||||||||||||||||||||||||||||||||||||||||||
| id="name" | ||||||||||||||||||||||||||||||||||||||||||||||||
| className="h-full" | ||||||||||||||||||||||||||||||||||||||||||||||||
| placeholder="닉네임을 입력해주세요." | ||||||||||||||||||||||||||||||||||||||||||||||||
| {...register('name', nameValidation)} | ||||||||||||||||||||||||||||||||||||||||||||||||
| errorMessage={errors.name?.message} | ||||||||||||||||||||||||||||||||||||||||||||||||
| state={isNameCheck ? 'success' : 'default'} | ||||||||||||||||||||||||||||||||||||||||||||||||
| onFocus={() => setFocusedField('name')} | ||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||||||||
| disabled={isNameCheck} | ||||||||||||||||||||||||||||||||||||||||||||||||
| variant={'outline'} | ||||||||||||||||||||||||||||||||||||||||||||||||
| size={'sm'} | ||||||||||||||||||||||||||||||||||||||||||||||||
| className="h-[50px]" | ||||||||||||||||||||||||||||||||||||||||||||||||
| type="button" | ||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={handleNameCheck} | ||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||
| 중복확인 | ||||||||||||||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
| <Button | |
| disabled={isNameCheck} | |
| variant={'outline'} | |
| size={'sm'} | |
| className="h-[50px]" | |
| type="button" | |
| onClick={handleNameCheck} | |
| > | |
| 중복확인 | |
| </Button> | |
| </div> | |
| <Button | |
| disabled={isNameCheck} | |
| variant={'outline'} | |
| size={'sm'} | |
| className="h-[50px]" | |
| type="button" | |
| isLoading={isCheckingName} | |
| onClick={handleNameCheck} | |
| > | |
| {isCheckingName ? '확인중...' : '중복확인'} | |
| </Button> | |
| </div> |
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.
🛠️ Refactor suggestion
폼 유효성 검사 상태 표시 필요
현재 제출 버튼은 폼의 유효성 검사 상태와 관계없이 활성화되어 있습니다. 모든 필드가 유효하지 않을 때는 버튼을 비활성화하거나 시각적으로 표시하여 사용자에게 명확한 피드백을 제공해야 합니다.
<div className="mb-[20px] mt-[48px] flex flex-col">
- <Button type="submit" className="w-full">
+ <Button
+ type="submit"
+ className="w-full"
+ disabled={!isValid || isSubmitting || !isNameCheck || !isEmailCheck}
+ >
회원가입
</Button>
</div>이렇게 수정하면 폼이 유효하지 않거나 제출 중일 때, 또는 닉네임과 이메일 중복 확인이 완료되지 않았을 때 버튼이 비활성화되어 사용자에게 더 명확한 지침을 제공할 수 있습니다.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <div className="mb-[20px] mt-[48px] flex flex-col"> | |
| <Button type="submit" className="w-full"> | |
| 회원가입 | |
| </Button> | |
| </div> | |
| <div className="mb-[20px] mt-[48px] flex flex-col"> | |
| <Button | |
| type="submit" | |
| className="w-full" | |
| disabled={!isValid || isSubmitting || !isNameCheck || !isEmailCheck} | |
| > | |
| 회원가입 | |
| </Button> | |
| </div> |
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.
🛠️ Refactor suggestion
ChipContainer 컴포넌트 재사용이 필요합니다.
이미 구현된 ChipContainer 컴포넌트를 재사용하여 코드 중복을 제거하는 것이 좋습니다.
📝 Committable suggestion