-
Notifications
You must be signed in to change notification settings - Fork 1
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
[#8] 회원가입, 로그인 페이지 레이아웃 #27
Changes from all commits
fd5734a
bf3c2dc
7a67ba2
b944c23
b08c3cc
4ad8ba6
d0c3805
3ddef8e
7c978dd
f3a8476
6689bbd
85b762b
7d39e88
10dfe5c
40684ae
2d44de5
431a905
a502347
3b877c2
7f44fd0
dc8caf3
7e2c85c
eb00d46
cc54b8c
1a9d264
0c678d9
772c1b3
e1a46e3
5b8e095
a74ad1e
36fa8a5
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,114 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import { ButtonText, InputValidation } from '@/types/login'; | ||
|
||
const LoginForm = () => { | ||
// HACK: 유효성 검사 기능 구현 후 유효성 메세지 노출 여부 결정 | ||
const isInvalid = true; | ||
|
||
return ( | ||
<form> | ||
<Inputs $isInvalid={isInvalid}> | ||
<Input | ||
type="email" | ||
placeholder="이메일 입력" | ||
/> | ||
<Input | ||
type="password" | ||
placeholder="비밀번호 입력" | ||
/> | ||
</Inputs> | ||
{isInvalid && ( | ||
<ValidationText> | ||
<ValidationBoldText>아이디</ValidationBoldText>를 입력해 주세요 | ||
</ValidationText> | ||
)} | ||
<Buttons $isInvalid={isInvalid}> | ||
<Button $text="login">로그인</Button> | ||
<Button $text="signUp">회원가입</Button> | ||
</Buttons> | ||
</form> | ||
); | ||
}; | ||
|
||
export default LoginForm; | ||
|
||
const Inputs = styled.div<InputValidation>` | ||
margin-bottom: ${props => (props.$isInvalid ? '10px' : '65px')}; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
gap: 19px; | ||
`; | ||
|
||
const Input = styled.input` | ||
width: 524px; | ||
height: 79px; | ||
|
||
border-radius: 16px; | ||
border: 2px solid #757676; | ||
padding: 23px 20px; | ||
|
||
display: flex; | ||
align-items: center; | ||
|
||
color: #1a2849; | ||
font-size: 18px; | ||
font-weight: 500; | ||
line-height: 32px; | ||
|
||
&::placeholder { | ||
color: #979c9e; | ||
font-size: 18px; | ||
font-weight: 500; | ||
line-height: 32px; | ||
} | ||
|
||
&:focus { | ||
outline: 2px solid #1a2849; | ||
border-color: #1a2849; | ||
} | ||
`; | ||
|
||
const ValidationText = styled.p` | ||
padding-left: 12px; | ||
|
||
color: #da1e28; | ||
font-size: 15px; | ||
font-weight: 500; | ||
line-height: 32px; | ||
`; | ||
|
||
const ValidationBoldText = styled.span` | ||
font-weight: 700; | ||
`; | ||
|
||
const Buttons = styled.div<InputValidation>` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 13px; | ||
|
||
${props => props.$isInvalid && 'margin-top: 23px'}; | ||
`; | ||
|
||
const Button = styled.button<ButtonText>` | ||
min-width: 524px; | ||
|
||
border: none; | ||
border-radius: 16px; | ||
padding: 23px 0; | ||
|
||
color: #fff; | ||
font-size: 22px; | ||
font-weight: 700; | ||
line-height: 32px; | ||
|
||
background: ${props => | ||
props.$text === 'login' | ||
? '#1A2849' | ||
: 'linear-gradient(91deg, #FF3478 1.39%, #FF83AD 98.63%)'}; | ||
Comment on lines
+108
to
+109
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. 요기만 왜 hex 코드가 소문자로 포맷팅이 안됐을까요? 그냥 궁금증.. |
||
|
||
&:hover { | ||
cursor: pointer; | ||
} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import logo from '@assets/icons/ic-logo.svg'; | ||
|
||
const LoginTitle = () => { | ||
return ( | ||
<TitleWrapper> | ||
<LogoIcon | ||
src={logo} | ||
alt="사장님 비서ya" | ||
/> | ||
<Title>통합 로그인</Title> | ||
</TitleWrapper> | ||
); | ||
}; | ||
|
||
export default LoginTitle; | ||
|
||
const LogoIcon = styled.img` | ||
width: 288px; | ||
height: 60px; | ||
`; | ||
|
||
const TitleWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 11px; | ||
|
||
text-align: center; | ||
`; | ||
|
||
const Title = styled.h1` | ||
color: #1a2849; | ||
font-size: 44.374px; | ||
font-weight: 900; | ||
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. 폰트 굵기 500이랑 700만 있는줄알았는데..! 300이랑 900도 추가해두겠습니다. |
||
line-height: 51.769px; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as LoginTitle } from './LoginTitle'; | ||
export { default as LoginForm } from './LoginForm'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import { SignUpDisabledButton, SignUpInputValidation } from '@/types/signUp'; | ||
|
||
const SignUpForm = () => { | ||
// TODO: react-hook-form 사용해서 유효성 검사 예정 | ||
const isInvalid = false; | ||
const isEmailValidationVisible = false; | ||
|
||
// 2가지 버튼 disabled 처리하기 위한 state | ||
const isEmailValidationDisabled = true; | ||
const isSubmitValidationDisabled = true; | ||
|
||
return ( | ||
<Form> | ||
<InputLabelWrapper> | ||
<Label htmlFor="user_name">이름</Label> | ||
<Input | ||
type="text" | ||
id="user_name" | ||
placeholder="이름 입력" | ||
required | ||
/> | ||
{isInvalid && ( | ||
<ValidationText $isInvalid={isInvalid}> | ||
이름을 입력해 주세요. | ||
</ValidationText> | ||
)} | ||
</InputLabelWrapper> | ||
Comment on lines
+16
to
+29
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. 향후 react-hook-form을 사용하게 되면 input 상태를 한번에 관리할 수 있을 것 같은데, 입력 받는 주제 단위로 컴포넌트를 Name, Email, Password로 분리해도 좋을 것 같다는 생각이 듭니다! react-hook-form 사용하실 때 분리하여 작업하는게 불편하다면 무시하셔도 상관없습니다! 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. 우선 이번 PR 이후 로그인/회원가입 화면에서 사용할 공통 input 컴포넌트를 만들 예정이긴 했습니다! 제안주신 Name, Email, Password로 컴포넌트를 분리해서 만드는 것은 react-hook-form 사용하기 전에 다시 한번 고려해보겠습니다..! |
||
<InputLabelWrapper> | ||
<Label htmlFor="user_email">이메일</Label> | ||
<EmailInputWrapper> | ||
<EmailInput | ||
type="email" | ||
id="user_email" | ||
placeholder="이메일 입력" | ||
required | ||
/> | ||
<EmailValidationButton $isDisabled={isEmailValidationDisabled}> | ||
중복확인 | ||
</EmailValidationButton> | ||
</EmailInputWrapper> | ||
{isEmailValidationVisible && ( | ||
<ValidationText $isInvalid={!isInvalid}> | ||
사용 가능한 아이디입니다. | ||
</ValidationText> | ||
)} | ||
</InputLabelWrapper> | ||
<InputLabelWrapper> | ||
<Label htmlFor="user_password">비밀번호</Label> | ||
<Input | ||
type="password" | ||
id="user_password" | ||
placeholder="8-20자, 영문/숫자/특수문자 조합" | ||
required | ||
/> | ||
{isInvalid && ( | ||
<ValidationText $isInvalid={isInvalid}> | ||
비밀번호 형식이 아닙니다. | ||
</ValidationText> | ||
)} | ||
</InputLabelWrapper> | ||
<InputLabelWrapper> | ||
<Label htmlFor="user_password_confirm">비밀번호 확인</Label> | ||
<Input | ||
type="password" | ||
id="user_password_confirm" | ||
placeholder="다시 한번 입력해주세요." | ||
required | ||
/> | ||
{isInvalid && ( | ||
<ValidationText $isInvalid={isInvalid}> | ||
비밀번호가 일치하지 않습니다. | ||
</ValidationText> | ||
)} | ||
</InputLabelWrapper> | ||
<SubmitButton $isDisabled={isSubmitValidationDisabled}> | ||
회원가입 | ||
</SubmitButton> | ||
</Form> | ||
); | ||
}; | ||
|
||
export default SignUpForm; | ||
|
||
const SubmitButton = styled.button<SignUpDisabledButton>` | ||
min-width: 524px; | ||
height: 78px; | ||
|
||
border: none; | ||
border-radius: 16px; | ||
padding: 23px auto; | ||
|
||
color: #fff; | ||
font-size: 22px; | ||
font-weight: 700; | ||
line-height: 32px; | ||
|
||
background: ${props => (props.$isDisabled ? '#C1C1C1' : '#1A2849')}; | ||
|
||
&:hover { | ||
cursor: pointer; | ||
} | ||
`; | ||
|
||
const Form = styled.form` | ||
margin-top: 26px; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
gap: 23px; | ||
`; | ||
|
||
const InputLabelWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
const Label = styled.label` | ||
margin-bottom: 10px; | ||
|
||
color: #757676; | ||
font-size: 18px; | ||
font-weight: 700; | ||
line-height: 32px; | ||
`; | ||
|
||
const Input = styled.input` | ||
width: 524px; | ||
height: 79px; | ||
|
||
border-radius: 16px; | ||
border: 2px solid #757676; | ||
padding: 23px 20px; | ||
|
||
display: flex; | ||
align-items: center; | ||
|
||
color: #1a2849; | ||
font-size: 18px; | ||
font-weight: 500; | ||
line-height: 32px; | ||
|
||
&::placeholder { | ||
color: #979c9e; | ||
font-size: 18px; | ||
font-weight: 500; | ||
line-height: 32px; | ||
} | ||
|
||
&:focus { | ||
outline: 2px solid #1a2849; | ||
border-color: #1a2849; | ||
} | ||
`; | ||
|
||
const EmailInputWrapper = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
`; | ||
|
||
const EmailInput = styled(Input)` | ||
width: 358px; | ||
`; | ||
|
||
const EmailValidationButton = styled(SubmitButton)` | ||
min-width: 152px; | ||
`; | ||
|
||
const ValidationText = styled.p<SignUpInputValidation>` | ||
margin-top: 2px; | ||
margin-left: 12px; | ||
|
||
color: ${props => (props.$isInvalid ? '#DA1E28' : '#1a2849')}; | ||
font-size: 15px; | ||
font-weight: 700; | ||
line-height: 32px; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
const SignUpTitle = () => { | ||
return ( | ||
<TitleWrapper> | ||
<Title>회원가입</Title> | ||
<Description> | ||
야놀자가 준비한 사장님 비서ya만의 혜택을 받아보세요. | ||
</Description> | ||
</TitleWrapper> | ||
); | ||
}; | ||
|
||
export default SignUpTitle; | ||
|
||
const TitleWrapper = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: flex-start; | ||
`; | ||
|
||
const Title = styled.h1` | ||
color: #202325; | ||
font-size: 26px; | ||
font-weight: 700; | ||
line-height: 31px; | ||
letter-spacing: -0.78px; | ||
`; | ||
|
||
const Description = styled.p` | ||
color: #979c9e; | ||
font-size: 18px; | ||
font-weight: 500; | ||
line-height: 32px; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as SignUpForm } from './SignUpForm'; | ||
export { default as SignUpTitle } from './SignUpTitle'; |
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.
ValidationText 에 font-weight: 700;를 바로 주지 않고 따로 스타일 컴포넌트로 뺀 이유가 궁금합니다!
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.
피그마에서 자세히 살펴보니 유효성 메세지 중
아이디
에 대해서만 bold 처리를 해두셨더라구요...! (착한 사람눈엔 보입니다..👀)