-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80e1770
commit 1512462
Showing
6 changed files
with
172 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Modal, Typo, Flex, Button } from '@components/common'; | ||
import { ReactNode } from 'react'; | ||
|
||
type Props = { | ||
content: ReactNode; | ||
onClose: () => void; | ||
}; | ||
|
||
export default function RoleModal({ content, onClose }: Props) { | ||
return ( | ||
<Modal | ||
textChildren={ | ||
<div css={{ textAlign: 'center' }}> | ||
<Typo element="strong" size="18px" bold> | ||
정보를 입력해주세요. <br /> | ||
<br /> | ||
{content} | ||
<br /> | ||
<br /> | ||
<span css={{ fontWeight: '400' }}>* 추후 마이페이지에서 수정 할 수 있습니다.</span> | ||
</Typo> | ||
<br /> | ||
</div> | ||
} | ||
buttonChildren={ | ||
<Flex gap={{ x: '16px' }}> | ||
<Button theme="default">등록할게요</Button> | ||
<Button theme="outlined">괜찮아요</Button> | ||
</Flex> | ||
} | ||
onClose={onClose} | ||
/> | ||
); | ||
} |
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,16 @@ | ||
import { Flex } from '@components/common'; | ||
import RoleSelector from './RoleSelector'; | ||
import { ReactNode } from 'react'; | ||
|
||
type Props = { | ||
onRoleSelect: (modalContent: ReactNode) => void; | ||
}; | ||
|
||
export default function RoleSelection({ onRoleSelect }: Props) { | ||
return ( | ||
<Flex justifyContent="center" alignItems="center" gap={{ x: '30px' }}> | ||
<RoleSelector role="employer" onClick={onRoleSelect} /> | ||
<RoleSelector role="worker" onClick={onRoleSelect} /> | ||
</Flex> | ||
); | ||
} |
26 changes: 26 additions & 0 deletions
26
src/features/auth/components/RoleSelector/index.config.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,26 @@ | ||
import { Icon } from '@components/common'; | ||
|
||
export const roleConfig = { | ||
employer: { | ||
icon: <Icon.Role.Employer />, | ||
text: '사업주 가입', | ||
modalContent: ( | ||
<> | ||
이력서에 대한 정보가 필요해요. | ||
<br /> | ||
이력서 정보를 등록하러 가실까요? | ||
</> | ||
), | ||
}, | ||
worker: { | ||
icon: <Icon.Role.Worker />, | ||
text: '근로자 가입', | ||
modalContent: ( | ||
<> | ||
사업장에 대한 정보가 필요해요. | ||
<br /> | ||
사업주 정보를 등록하러 가실까요? | ||
</> | ||
), | ||
}, | ||
}; |
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,27 @@ | ||
import { Card, Flex, Typo } from '@components/common'; | ||
import { roleConfig } from './index.config'; | ||
import { bounceAnimation } from '@assets/styles/animations'; | ||
import { ReactNode } from 'react'; | ||
|
||
type Props = { | ||
role: 'employer' | 'worker'; | ||
onClick: (modalContent: ReactNode) => void; | ||
}; | ||
|
||
export default function RoleSelector({ role, onClick }: Props) { | ||
return ( | ||
<Card | ||
borderColor="blue" | ||
borderRadius="12px" | ||
css={[bounceAnimation, { padding: '60px 120px', cursor: 'pointer' }]} | ||
onClick={() => onClick(roleConfig[role].modalContent)} | ||
> | ||
<Flex direction="column" alignItems="center"> | ||
<div css={{ marginBottom: '24px' }}>{roleConfig[role].icon}</div> | ||
<Typo element="h2" color="blue" size="18px" bold> | ||
{roleConfig[role].text} | ||
</Typo> | ||
</Flex> | ||
</Card> | ||
); | ||
} |
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,9 +1,68 @@ | ||
import { ReactNode, useState } from 'react'; | ||
import Layout from '@features/layout'; | ||
import { Flex, Typo, InnerContainer } from '@components/common'; | ||
import { responsiveStyle, responsiveSectionPadding } from '@assets/styles/helpers/responsive'; | ||
import RoleSelection from '@features/auth/components/RoleSelection'; | ||
import RoleModal from '@features/auth/components/RoleModal'; | ||
import useToggle from '@hooks/useToggle'; | ||
|
||
export default function SignUp() { | ||
const [isToggle, toggle] = useToggle(); | ||
const [modalContent, setModalContent] = useState<ReactNode>(); | ||
|
||
const handleRoleSelect = (modalContent: ReactNode) => { | ||
toggle(); | ||
setModalContent(modalContent); | ||
}; | ||
|
||
return ( | ||
<Layout> | ||
<h1>hello World</h1> | ||
<section css={responsiveStyle(responsiveSectionPadding)}> | ||
<InnerContainer maxWidth="1300px"> | ||
<Flex direction="column" justifyContent="center" alignItems="center"> | ||
<Typo | ||
element="h1" | ||
size="24px" | ||
bold | ||
style={{ | ||
marginBottom: '38px', | ||
...responsiveStyle({ | ||
tablet: { | ||
marginBottom: '28px', | ||
}, | ||
mobile: { | ||
marginBottom: '20px', | ||
fontSize: '20px', | ||
}, | ||
}), | ||
}} | ||
> | ||
가입자 정보 선택 | ||
</Typo> | ||
<Typo | ||
element="p" | ||
size="20px" | ||
color="gray" | ||
style={{ | ||
marginBottom: '38px', | ||
...responsiveStyle({ | ||
tablet: { | ||
marginBottom: '28px', | ||
}, | ||
mobile: { | ||
marginBottom: '20px', | ||
fontSize: '16px', | ||
}, | ||
}), | ||
}} | ||
> | ||
대상에 해당하는 가입자 정보를 선택해주세요. | ||
</Typo> | ||
</Flex> | ||
<RoleSelection onRoleSelect={handleRoleSelect} /> | ||
</InnerContainer> | ||
</section> | ||
{isToggle && <RoleModal content={modalContent} onClose={toggle} />} | ||
</Layout> | ||
); | ||
} |