Skip to content

Commit

Permalink
feat(processes/profile): add example hobby list
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Jul 21, 2024
1 parent 293affc commit 1886f87
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 55 deletions.
15 changes: 15 additions & 0 deletions src/entities/hobby/constants/hobbies.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Hobby } from 'src/entities/hobby/types/hobby';

export const ExampleHobbyList: Hobby[] = [
{ name: '🧗 클라이밍' },
{ name: '🥐 맛집탐방' },
{ name: '🎬 영화보기' },
{ name: '👟 운동' },
{ name: '🧶 뜨개질' },
{ name: '🧑‍💻 개발공부' },
{ name: '📖 독서' },
{ name: '🍷 와인' },
{ name: '🏊 수영' },
{ name: '🏌️ 골프' },
{ name: '🎹 악기연주' },
];
File renamed without changes.
2 changes: 1 addition & 1 deletion src/entities/ideal_partner/model/idealPartnerStore.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Location } from 'src/entities/location/types/location';
import { ReligionType } from 'src/entities/profile/types/profileSummary';
import { create } from 'zustand';
import { Hobby } from 'src/entities/profile/types/hobby';
import { Hobby } from 'src/entities/hobby/types/hobby';
import { createStoreContext } from 'src/shared/functions/createStoreContext';
import { MAX_IDEAL_HEIGHT, MIN_IDEAL_HEIGHT } from 'src/processes/ideal_partner/HeightStyleForm/HeightStyleForm';

Expand Down
2 changes: 1 addition & 1 deletion src/entities/profile/model/myProfileStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Gender, JobType, ReligionType } from 'src/entities/profile/types/profil
import { Location } from 'src/entities/location/types/location';
import { DateObj } from 'src/shared/vo/date';
import { Mbti } from 'src/shared/vo/mbti';
import { Hobby } from 'src/entities/profile/types/hobby';
import { Hobby } from 'src/entities/hobby/types/hobby';
import { createStoreContext } from 'src/shared/functions/createStoreContext';

export type MyProfile = {
Expand Down
6 changes: 3 additions & 3 deletions src/entities/profile/ui/MyProfile/MyProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ProfileCellHeader } from 'src/shared/ui/Profile/ProfileCellHeader';
export const MyProfileView = ({ profile }: { profile: MyProfile }) => {
return (
<section>
<Accordion summary={'기본 개인정보'} initialOpen>
<Accordion summary={'기본 개인정보'}>
<Spacing size={32} />
<div className={styles.Grid}>
<div className={styles.GridRow}>
Expand Down Expand Up @@ -71,7 +71,7 @@ export const MyProfileView = ({ profile }: { profile: MyProfile }) => {
</div>
</Accordion>
<Spacing size={32} />
<Accordion summary={'개인 취향 및 선호도 관련'} initialOpen>
<Accordion summary={'개인 취향 및 선호도 관련'}>
<Spacing size={32} />
<div className={styles.Grid}>
<div className={styles.GridRow}>
Expand Down Expand Up @@ -101,7 +101,7 @@ export const MyProfileView = ({ profile }: { profile: MyProfile }) => {
</div>
</Accordion>
<Spacing size={32} />
<Accordion summary={'선택 질문'} initialOpen>
<Accordion summary={'선택 질문'}>
<Spacing size={32} />
<div className={styles.Grid}>
<div className={styles.GridRow}>
Expand Down
19 changes: 1 addition & 18 deletions src/processes/ideal_partner/HobbyForm/HobbyForm.stories.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Meta, StoryObj } from '@storybook/react';
import { HobbyForm } from 'src/processes/ideal_partner/HobbyForm/HobbyForm';
import { Hobby } from 'src/entities/profile/types/hobby';

const meta: Meta<typeof HobbyForm> = {
component: HobbyForm,
Expand All @@ -9,22 +8,6 @@ const meta: Meta<typeof HobbyForm> = {
export default meta;
type Story = StoryObj<typeof HobbyForm>;

const MockHobbyList: Hobby[] = [
{ name: '🧗 클라이밍' },
{ name: '🥐 맛집탐방' },
{ name: '🎬 영화보기' },
{ name: '👟 운동' },
{ name: '🧶 뜨개질' },
{ name: '🧑‍💻 개발공부' },
{ name: '📖 독서' },
{ name: '🍷 와인' },
{ name: '🏊 수영' },
{ name: '🏌️ 골프' },
{ name: '🎹 악기연주' },
];

export const Default: Story = {
args: {
exampleHobbyList: MockHobbyList,
},
args: {},
};
10 changes: 3 additions & 7 deletions src/processes/ideal_partner/HobbyForm/HobbyForm.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import styles from './HobbyForm.module.css';
import { useIdealPartnerStore } from 'src/entities/ideal_partner/model/idealPartnerStore';
import { ChipList } from 'src/shared/ui/ChipList/ChipList';
import { Hobby } from 'src/entities/profile/types/hobby';
import { ExampleHobbyList } from 'src/entities/hobby/constants/hobbies';

type HobbyFormProps = {
exampleHobbyList?: Hobby[];
};

export const HobbyForm = ({ exampleHobbyList = [] }: HobbyFormProps) => {
export const HobbyForm = () => {
const hobbies = useIdealPartnerStore((state) => state.hobbies);
const setHobbies = useIdealPartnerStore((state) => state.setHobbies);

return (
<>
<section className={styles.Container}>
<ChipList
defaultList={exampleHobbyList}
defaultList={ExampleHobbyList}
selectedList={hobbies}
setSelectedList={setHobbies}
customInputTitle={'추가하실 취미를 입력해주세요.'}
Expand Down
20 changes: 2 additions & 18 deletions src/processes/my_profile/HobbyForm/HobbyForm.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta, StoryObj } from '@storybook/react';
import { Hobby, HobbyForm } from 'src/processes/my_profile/HobbyForm/HobbyForm';
import { HobbyForm } from 'src/processes/my_profile/HobbyForm/HobbyForm';

const meta: Meta<typeof HobbyForm> = {
component: HobbyForm,
Expand All @@ -8,22 +8,6 @@ const meta: Meta<typeof HobbyForm> = {
export default meta;
type Story = StoryObj<typeof HobbyForm>;

const MockHobbyList: Hobby[] = [
{ name: '🧗 클라이밍' },
{ name: '🥐 맛집탐방' },
{ name: '🎬 영화보기' },
{ name: '👟 운동' },
{ name: '🧶 뜨개질' },
{ name: '🧑‍💻 개발공부' },
{ name: '📖 독서' },
{ name: '🍷 와인' },
{ name: '🏊 수영' },
{ name: '🏌️ 골프' },
{ name: '🎹 악기연주' },
];

export const Default: Story = {
args: {
hobbyList: MockHobbyList,
},
args: {},
};
10 changes: 3 additions & 7 deletions src/processes/my_profile/HobbyForm/HobbyForm.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import styles from './HobbyForm.module.css';
import { ChipList } from 'src/shared/ui/ChipList/ChipList';
import { useMyProfileStore } from 'src/entities/profile/model/myProfileStore';
import { Hobby } from 'src/entities/profile/types/hobby';
import { ExampleHobbyList } from 'src/entities/hobby/constants/hobbies';

type HobbyFormProps = {
hobbyList?: Hobby[];
};

export const HobbyForm = ({ hobbyList = [] }: HobbyFormProps) => {
export const HobbyForm = () => {
const hobbies = useMyProfileStore((state) => state.hobbies);
const setHobbies = useMyProfileStore((state) => state.setHobbies);

return (
<section className={styles.Container}>
<ChipList
defaultList={hobbyList}
defaultList={ExampleHobbyList}
selectedList={hobbies}
setSelectedList={setHobbies}
customInputTitle={'추가하실 취미를 입력해주세요.'}
Expand Down

0 comments on commit 1886f87

Please sign in to comment.