-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from kakao-tech-campus-2nd-step3/Develop
Develop
- Loading branch information
Showing
20 changed files
with
2,155 additions
and
5,059 deletions.
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
export const RouterPath = { | ||
root: '/', | ||
login: '/login', | ||
register: '/register', | ||
mypage: `/mypage`, | ||
serviceHistory: `/service-history`, | ||
helloCallService: 'service', | ||
helloCallReport: 'report', | ||
helloCall: `/hello-call`, | ||
callBackList: '/call-back', | ||
callBackDetail: ':callBackId', | ||
callBackGuidLine: ':guideLineId', | ||
seniorRegister: `/senior-register`, | ||
ROOT: '/', | ||
LOGIN: '/login', | ||
REGISTER: '/register', | ||
MYPAGE: `/mypage`, | ||
SERVICE_HISTORY: `/service-history`, | ||
HELLO_CALL_SERVICE: 'service', | ||
HELLO_CALL_REPORT: 'report', | ||
HELLO_CALL: `/hello-call`, | ||
CALL_BACK_LIST: '/call-back', | ||
CALL_BACK_DETAIL: ':callBackId', | ||
CALL_BACK_GUID_LINE: ':guideLineId', | ||
SENIOR_REGISTER: `/senior-register`, | ||
SINIDDO_REVIEW: `/siniddo-review`, | ||
}; |
38 changes: 38 additions & 0 deletions
38
src/pages/common/register/components/register-fields/form-fileds/index.tsx
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,38 @@ | ||
import { UseFormRegister } from 'react-hook-form'; | ||
|
||
import type { FormValues } from '../../../types'; | ||
import { Input, FormControl, FormErrorMessage } from '@chakra-ui/react'; | ||
import styled from '@emotion/styled'; | ||
|
||
type Props = { | ||
label: string; | ||
placeholder: string; | ||
error?: string; | ||
registerProps: ReturnType<UseFormRegister<FormValues>>; | ||
}; | ||
|
||
export const FormField = ({ | ||
label, | ||
placeholder, | ||
error, | ||
registerProps, | ||
}: Props) => ( | ||
<FormControl isInvalid={!!error}> | ||
<Title> | ||
<EmphasisSpan>{label}</EmphasisSpan>μ μ λ ₯ν΄μ£ΌμΈμ. | ||
</Title> | ||
<Input size='lg' placeholder={placeholder} {...registerProps} /> | ||
{error && <FormErrorMessage>{error}</FormErrorMessage>} | ||
</FormControl> | ||
); | ||
|
||
const Title = styled.h1` | ||
font-size: 24px; | ||
font-weight: 700; | ||
margin-top: 30px; | ||
margin-bottom: 10px; | ||
`; | ||
|
||
const EmphasisSpan = styled.span` | ||
color: #c69090; | ||
`; |
50 changes: 28 additions & 22 deletions
50
src/pages/common/register/components/register-fields/index.tsx
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,33 +1,39 @@ | ||
import { Input } from '@chakra-ui/react'; | ||
import { FieldErrors, UseFormRegister } from 'react-hook-form'; | ||
|
||
import type { FormValues } from '../../types'; | ||
import { FormField } from './form-fileds'; | ||
import styled from '@emotion/styled'; | ||
|
||
export const RegisterFields = () => { | ||
type Props = { | ||
register: UseFormRegister<FormValues>; | ||
errors: FieldErrors<FormValues>; | ||
}; | ||
|
||
export const RegisterFields = ({ register, errors }: Props) => { | ||
return ( | ||
<Wrapper> | ||
<Title> | ||
<EmphasisSpan>μ΄λ¦</EmphasisSpan>μ μ λ ₯ν΄μ£ΌμΈμ. | ||
</Title> | ||
<Input size='lg' placeholder='μμ: νκΈΈλ' /> | ||
|
||
<Title> | ||
<EmphasisSpan>μ°λ½μ²</EmphasisSpan>λ₯Ό μ λ ₯ν΄μ£ΌμΈμ. | ||
</Title> | ||
<Input size='lg' placeholder='μμ: 010-0000-0000' /> | ||
<FormField | ||
label='μ΄λ¦' | ||
placeholder='μμ: νκΈΈλ' | ||
error={errors.name?.message} | ||
registerProps={register('name', { required: 'μ΄λ¦μ μ λ ₯ν΄μ£ΌμΈμ.' })} | ||
/> | ||
<FormField | ||
label='μ°λ½μ²' | ||
placeholder='μμ: 010-0000-0000' | ||
error={errors.phoneNumber?.message} | ||
registerProps={register('phoneNumber', { | ||
required: 'μ°λ½μ²λ₯Ό μ λ ₯ν΄μ£ΌμΈμ.', | ||
pattern: { | ||
value: /^010-\d{4}-\d{4}$/, | ||
message: 'μ ν¨ν μ°λ½μ² νμμ΄ μλλλ€.', | ||
}, | ||
})} | ||
/> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
const Wrapper = styled.div` | ||
width: 100%; | ||
`; | ||
|
||
const Title = styled.h1` | ||
font-size: 24px; | ||
font-weight: 700; | ||
margin-top: 30px; | ||
margin-bottom: 10px; | ||
`; | ||
|
||
const EmphasisSpan = styled.span` | ||
color: #c69090; | ||
`; |
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
37 changes: 37 additions & 0 deletions
37
src/pages/common/register/components/register-type/type-button.tsx/index.tsx
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,37 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
type Props = { | ||
id: string; | ||
isSelected: boolean; | ||
content: string; | ||
handleClick: (id: string) => void; | ||
}; | ||
|
||
export const TypeButton = ({ content, isSelected, id, handleClick }: Props) => { | ||
return ( | ||
<TypeBtn | ||
type='button' | ||
isSelected={isSelected} | ||
onClick={() => handleClick(id)} | ||
> | ||
{content} | ||
</TypeBtn> | ||
); | ||
}; | ||
|
||
type BtnProps = { | ||
isSelected: boolean; | ||
}; | ||
|
||
const TypeBtn = styled.button<BtnProps>` | ||
width: 45%; | ||
height: 70px; | ||
border-radius: 10px; | ||
background-color: ${(props) => | ||
props.isSelected ? 'var(--color-primary)' : '#f2f2f2'}; | ||
color: ${(props) => (props.isSelected ? 'var(--color-white)' : '#909090')}; | ||
font-size: 22px; | ||
font-weight: ${(props) => (props.isSelected ? '600' : '400')}; | ||
outline: 0; | ||
`; |
13 changes: 8 additions & 5 deletions
13
...n/register/components/tos/guard/index.tsx β ...register/components/tos/content/index.tsx
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.