-
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(entity/idealPartner): add ideal partner profile
- Loading branch information
Showing
6 changed files
with
127 additions
and
28 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/entities/ideal_partner/api/__mock__/idealPartner.mock.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,18 @@ | ||
import { IdealPartner } from 'src/entities/ideal_partner/model/idealPartnerStore'; | ||
|
||
export const MockIdealPartner: IdealPartner = { | ||
ageRange: { max: 25, min: 20 }, | ||
drinking: { drinkingAmount: '주 1-2회 가볍게는 괜찮아요', drinkingCategory: '' }, | ||
heightRange: { max: 180, min: 175 }, | ||
hobbies: [{ name: '맛집탐방' }, { name: '뜨개질' }], | ||
images: [], | ||
locations: [ | ||
{ city: { cityName: '서울시', city: 'SEOUL' }, town: [{ town: 'GANGNAM', townName: '강남구' }] }, | ||
{ city: { cityName: '경기도', city: 'RUDRL' }, town: [{ town: 'SUWON', townName: '수원시' }] }, | ||
], | ||
religion: { religionCategory: 'NONE', religionName: '' }, | ||
requiredOptions: [], | ||
smoking: { smokingAmount: '', smokingCategory: 'NON_SMOKER' }, | ||
style: '눈이 크신 분', | ||
toMatchMaker: '잘 부탁드립니다 !', | ||
}; |
16 changes: 16 additions & 0 deletions
16
src/entities/ideal_partner/ui/IdealPartnerProfile/IdealPartnerProfile.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,16 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { IdealPartnerProfile } from 'src/entities/ideal_partner/ui/IdealPartnerProfile/IdealPartnerProfile'; | ||
import { MockIdealPartner } from 'src/entities/ideal_partner/api/__mock__/idealPartner.mock'; | ||
|
||
const meta: Meta<typeof IdealPartnerProfile> = { | ||
component: IdealPartnerProfile, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof IdealPartnerProfile>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
profile: MockIdealPartner, | ||
}, | ||
}; |
64 changes: 64 additions & 0 deletions
64
src/entities/ideal_partner/ui/IdealPartnerProfile/IdealPartnerProfile.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,64 @@ | ||
import { IdealPartner } from 'src/entities/ideal_partner/model/idealPartnerStore'; | ||
import { AvatarList } from 'src/shared/ui/AvatarList/AvatarList'; | ||
import { Chip } from 'src/shared/ui/Chip/Chip'; | ||
import { ProfileCellHeader } from 'src/shared/ui/Profile/ProfileCellHeader'; | ||
import styles from 'src/shared/ui/Profile/Profile.module.css'; | ||
|
||
export const IdealPartnerProfile = ({ profile }: { profile: IdealPartner }) => { | ||
return ( | ||
<section className={styles.Grid}> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'선호하는 연령대'} /> | ||
<span> | ||
{profile.ageRange.min}-{profile.ageRange.max} | ||
</span> | ||
</div> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'선호하는 키'} /> | ||
<span> | ||
{profile.heightRange.min}-{profile.heightRange.max} | ||
</span> | ||
</div> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'선호하는 스타일'} /> | ||
<span>{profile.style}</span> | ||
</div> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'이상형 참고 사진'} /> | ||
<span> | ||
<AvatarList files={profile.images} /> | ||
</span> | ||
</div> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'희망 지역'} /> | ||
<span> | ||
{profile.locations.map(({ city, town }) => town.map((t) => `${city.cityName} ${t.townName}`)).join(', ')} | ||
</span> | ||
</div> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'취미'} /> | ||
<div className={styles.HorizontalList}> | ||
{profile.hobbies.map((hobby) => ( | ||
<Chip key={hobby.name}>{hobby.name}</Chip> | ||
))} | ||
</div> | ||
</div> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'종교'} /> | ||
<span>{profile.religion.religionCategory}</span> | ||
</div> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'음주 빈도'} /> | ||
<span>{profile.drinking.drinkingCategory}</span> | ||
</div> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'흡연여부'} /> | ||
<span>{profile.smoking.smokingCategory}</span> | ||
</div> | ||
<div className={styles.Cell}> | ||
<ProfileCellHeader title={'주선자에게 전달하고 싶은 말'} /> | ||
<span>{profile.toMatchMaker}</span> | ||
</div> | ||
</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
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 |
---|---|---|
|
@@ -31,7 +31,6 @@ | |
display: flex; | ||
overflow-x: auto; | ||
gap: 8px; | ||
height: 72px; | ||
|
||
& > * { | ||
flex-shrink: 0; | ||
|
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,11 @@ | ||
import styles from './Profile.module.css'; | ||
import { Edit } from 'src/shared/ui/icons'; | ||
|
||
export const ProfileCellHeader = ({ title }: { title: string }) => { | ||
return ( | ||
<div className={styles.CellHeader}> | ||
<span className={styles.CellHeaderTitle}>{title}</span> | ||
<Edit width={15} height={15} /> | ||
</div> | ||
); | ||
}; |