-
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.
feat(processes/profile): add smoke and alcohol form
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/processes/my_profile/SmokeAlcoholForm/SmokeAlcoholForm.module.css
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,9 @@ | ||
.Container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 40px; | ||
} | ||
|
||
.Legend { | ||
margin-bottom: 8px; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/processes/my_profile/SmokeAlcoholForm/SmokeAlcoholForm.stories.ts
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,13 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { SmokeAlcoholForm } from 'src/processes/my_profile/SmokeAlcoholForm/SmokeAlcoholForm'; | ||
|
||
const meta: Meta<typeof SmokeAlcoholForm> = { | ||
component: SmokeAlcoholForm, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof SmokeAlcoholForm>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
}; |
28 changes: 28 additions & 0 deletions
28
src/processes/my_profile/SmokeAlcoholForm/SmokeAlcoholForm.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,28 @@ | ||
import { Input } from 'src/shared/ui/Input/Input'; | ||
import styles from './SmokeAlcoholForm.module.css'; | ||
import { RadioList, RadioMeta } from 'src/shared/ui/RadioList/RadioList'; | ||
import { useState } from 'react'; | ||
|
||
const SmokeTypeList = ['NO', 'YES', 'ETC']; | ||
type SmokeType = (typeof SmokeTypeList)[number]; | ||
const SmokeMetaList: RadioMeta<SmokeType>[] = [ | ||
{ key: 'NO', name: '안합니다', allowInput: false }, | ||
{ key: 'YES', name: '합니다', allowInput: false }, | ||
{ key: 'ETC', name: '기타', allowInput: true, placeholder: '담배는 언제 피는 편인가요?' }, | ||
]; | ||
|
||
export const SmokeAlcoholForm = () => { | ||
const [selected, setSelected] = useState<SmokeType | null>(null); | ||
return ( | ||
<section className={styles.Container}> | ||
<fieldset> | ||
<legend className={`strong ${styles.Legend}`}>술자리 빈도</legend> | ||
<Input placeholder={'ex. 가볍게 주 2회, 친구들과 주 1회, 회식 매 달 1회...'} /> | ||
</fieldset> | ||
<fieldset> | ||
<legend className={`strong ${styles.Legend}`}>흡연 여부</legend> | ||
<RadioList radioMetaList={SmokeMetaList} selected={selected} onSelect={setSelected} /> | ||
</fieldset> | ||
</section> | ||
); | ||
}; |
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