-
Notifications
You must be signed in to change notification settings - Fork 0
[DESIGN] 로그인페이지 ui 수정사항 반영 #27
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 all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,26 +1,49 @@ | ||||||||||||||||||||||||||
| import Button from '@/components/common/Button' | ||||||||||||||||||||||||||
| import Input from '@/components/common/Input' | ||||||||||||||||||||||||||
| import SignupIcon from '@/assets/icons/signup/auth-checkbox.svg?react' | ||||||||||||||||||||||||||
| import EyeClosed from '@/assets/icons/signup/eye-close.svg?react' | ||||||||||||||||||||||||||
| import EyeOpen from '@/assets/icons/signup/eye-open.svg?react' | ||||||||||||||||||||||||||
| import CheckIcon from '@/assets/icons/signup/check-icon.svg?react' | ||||||||||||||||||||||||||
| import SignupIcon from '@/assets/icons/auth/auth-checkbox.svg?react' | ||||||||||||||||||||||||||
| import EyeClosed from '@/assets/icons/auth/eye-close.svg?react' | ||||||||||||||||||||||||||
| import EyeOpen from '@/assets/icons/auth/eye-open.svg?react' | ||||||||||||||||||||||||||
| import CheckIcon from '@/assets/icons/auth/check-icon.svg?react' | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| import { useState } from 'react' | ||||||||||||||||||||||||||
| import { type LoginFormType } from '@/utils/validate' | ||||||||||||||||||||||||||
| import { useLoginForm } from '@/hooks/useForm' | ||||||||||||||||||||||||||
| import { useNavigate } from 'react-router' | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const AuthForm = () => { | ||||||||||||||||||||||||||
| const [showPassword, setShowPassword] = useState<boolean>(false) | ||||||||||||||||||||||||||
| const { register, handleSubmit, errors, watch, isValid, isDirty } = useLoginForm() | ||||||||||||||||||||||||||
| const [loginError, setLoginError] = useState<string>('') | ||||||||||||||||||||||||||
| const navigate = useNavigate() | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // 유효성 검사용 | ||||||||||||||||||||||||||
| const { register, handleSubmit, errors, watch } = useLoginForm() | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // 폼 데이터 감시 | ||||||||||||||||||||||||||
| const email = watch('email') | ||||||||||||||||||||||||||
| const password = watch('password') | ||||||||||||||||||||||||||
| const isAuthLogin = watch('autoLogin') | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const onSubmit = (data: LoginFormType) => { | ||||||||||||||||||||||||||
| console.log('🍀 로그인 폼 제출 성공~!', data) | ||||||||||||||||||||||||||
| // 이메일과 비밀번호가 모두 입력되었는지 확인 (버튼 활성/비활성화용) | ||||||||||||||||||||||||||
| const isFormFilled = email && password | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // 폼 제출 (로그인 버튼 클릭) | ||||||||||||||||||||||||||
| const onSubmit = () => { | ||||||||||||||||||||||||||
| setLoginError('') | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // 나중에 api연결로 대체 | ||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||
| if (email === 'test@naver.com' && password === 'qwerty1!') { | ||||||||||||||||||||||||||
| console.log('로그인 성공!', email, password) | ||||||||||||||||||||||||||
| navigate('/') | ||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||
| setLoginError('가입되지 않은 계정이거나, 아이디/비밀번호가 일치하지 않습니다.') | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||
|
Comment on lines
+33
to
+40
|
||||||||||||||||||||||||||
| try { | |
| if (email === 'test@naver.com' && password === 'qwerty1!') { | |
| console.log('로그인 성공!', email, password) | |
| navigate('/') | |
| } else { | |
| setLoginError('가입되지 않은 계정이거나, 아이디/비밀번호가 일치하지 않습니다.') | |
| } | |
| } catch { | |
| if (email === 'test@naver.com' && password === 'qwerty1!') { | |
| console.log('로그인 성공!', email, password) | |
| navigate('/') | |
| } else { |
Copilot
AI
Jan 17, 2026
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.
The onSubmit function doesn't accept the validated form data parameter that react-hook-form's handleSubmit passes. While using watch() to access values works, this bypasses the standard pattern where validated data is passed as a parameter. This makes the code less clear about where the data comes from and whether it's validated. Consider accepting a parameter of type LoginFormType to follow react-hook-form best practices and make the data flow more explicit.
Copilot
AI
Jan 17, 2026
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.
The class 'w-105' uses a non-standard Tailwind width value. Tailwind's default spacing scale goes up to 96 (384px), and '105' is not a standard value. This will likely not work unless a custom width has been defined in the Tailwind config. Consider using standard Tailwind width values like 'w-96' (24rem / 384px) or a custom arbitrary value like 'w-[420px]' if a specific pixel width is required, or define this custom value in your Tailwind configuration.
| <div className=' w-105 mb-6.5'> | |
| <div className=' w-[420px] mb-6.5'> |
Copilot
AI
Jan 17, 2026
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.
The error display logic only shows email validation errors and ignores password validation errors. If a password error exists (e.g., empty password since min(1) is now required), it won't be displayed to the user. The condition should check for both errors.email and errors.password to provide complete validation feedback.
Copilot
AI
Jan 17, 2026
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.
These interactive elements use span tags with cursor-pointer and hover styles, but they lack proper accessibility attributes and keyboard navigation support. Consider using button elements or adding role="button", tabIndex="0", and keyboard event handlers (onKeyDown) to make them accessible to keyboard users and screen readers.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,14 +1,10 @@ | ||||||||||
| import NectIcon from '@/assets/icons/common/logo.svg?react' | ||||||||||
| import NECT from '@/assets/icons/common/NECT.svg?react' | ||||||||||
| import NectLogoIcon from '@/assets/icons/common/nect-logo.svg?react' | ||||||||||
|
|
||||||||||
| const AuthHeader = () => { | ||||||||||
| return ( | ||||||||||
| <> | ||||||||||
| <div className=' flex flex-col items-center justify-center mb-10.75 gap-4.75'> | ||||||||||
| <div className='flex justify-center items-center gap-4.5'> | ||||||||||
| <NectIcon /> | ||||||||||
| <NECT /> | ||||||||||
| </div> | ||||||||||
| <div className=' flex flex-col items-center justify-center mb-10.5 gap-4.75'> | ||||||||||
| <NectLogoIcon className='w-56.5 h-10' /> | ||||||||||
|
Comment on lines
+6
to
+7
|
||||||||||
| <div className=' flex flex-col items-center justify-center mb-10.5 gap-4.75'> | |
| <NectLogoIcon className='w-56.5 h-10' /> | |
| <div className=' flex flex-col items-center justify-center mb-[42px] gap-[19px]'> | |
| <NectLogoIcon className='w-[226px] h-10' /> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||
| import GoogleIcon from '@/assets/icons/signup/google.svg?react' | ||||||
| import KakaoIcon from '@/assets/icons/signup/kakao.svg?react' | ||||||
| import GoogleIcon from '@/assets/icons/auth/google.svg?react' | ||||||
| import KakaoIcon from '@/assets/icons/auth/kakao.svg?react' | ||||||
| import Button from '@/components/common/Button' | ||||||
|
|
||||||
| const SocialLogin = () => { | ||||||
|
|
@@ -13,13 +13,13 @@ const SocialLogin = () => { | |||||
| </div> | ||||||
|
|
||||||
| {/* 소셜 로그인 */} | ||||||
| <div className='w-[50%] flex flex-col gap-3'> | ||||||
| <div className='w-105 flex flex-col gap-3'> | ||||||
|
||||||
| <div className='w-105 flex flex-col gap-3'> | |
| <div className='w-[420px] flex flex-col gap-3'> |
Copilot
AI
Jan 17, 2026
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.
The Kakao login button applies 'bg-social-kakao border-none' as className props, but the socialLogin button style already includes 'border border-neutral-300'. When applying 'border-none' through className, it should override the border, but there might be specificity issues. Consider refactoring the Button component to accept a variant prop for different social login providers rather than overriding styles through className, which is more maintainable and follows component design best practices.
| <Button color='socialLogin' fullWidth className='bg-social-kakao border-none'> | |
| <Button color='socialLogin' fullWidth className='bg-social-kakao'> |
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.
Hardcoded test credentials should not be committed to the repository, even with a comment indicating they are temporary. This is a security risk as it exposes valid test credentials that could be used maliciously. Consider using environment variables or a separate configuration file that is not committed to version control for test credentials.