Skip to content

Commit

Permalink
✏️ 데이터 스키마와 프로퍼티명 일치화
Browse files Browse the repository at this point in the history
  • Loading branch information
js43o committed Nov 22, 2023
1 parent 5fda3aa commit 0cf538e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
7 changes: 0 additions & 7 deletions app/frontend/src/components/MogacoDetail/DetailContent.tsx

This file was deleted.

7 changes: 7 additions & 0 deletions app/frontend/src/components/MogacoDetail/DetailContents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type DetailContentsProps = {
contents: string;
};

export function DetailContents({ contents }: DetailContentsProps) {
return <div>{contents}</div>;
}
27 changes: 14 additions & 13 deletions app/frontend/src/components/MogacoDetail/DetailInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useState } from 'react';

import dayjs from 'dayjs';

import { ReactComponent as ArrowDown } from '@/assets/icons/arrow_down.svg';
import { ReactComponent as Calendar } from '@/assets/icons/calendar_large.svg';
import { ReactComponent as Map } from '@/assets/icons/map_large.svg';
Expand All @@ -12,17 +14,17 @@ import { Participant } from '@/types';
import * as styles from './index.css';

type DetailInfoProps = {
participants: Participant[];
maxParticipantsNumber: number;
datetime: string;
location: string;
participantList: Participant[];
maxHumanCount: number;
date: string;
address: string;
};

export function DetailInfo({
participants,
maxParticipantsNumber,
datetime,
location,
participantList,
maxHumanCount,
date,
address,
}: DetailInfoProps) {
const [participantsShown, setParticipantsShown] = useState(false);

Expand All @@ -34,8 +36,7 @@ export function DetailInfo({
<div className={styles.infoItem}>
<People fill={vars.color.grayscale200} />
<span>
<span>{participants.length}</span>/
<span>{maxParticipantsNumber}</span>
<span>{participantList.length}</span>/<span>{maxHumanCount}</span>
</span>
<button
type="button"
Expand All @@ -52,7 +53,7 @@ export function DetailInfo({
participantsShown ? styles.shown : ''
}`}
>
{participants.map((participant) => (
{participantList.map((participant) => (
<UserChip
key={participant.id}
username={participant.nickname}
Expand All @@ -62,11 +63,11 @@ export function DetailInfo({
</div>
<div className={styles.infoItem}>
<Calendar fill={vars.color.grayscale200} />
<span>{datetime}</span>
<span>{dayjs(date).format('YYYY/MM/DD HH:mm~')}</span>
</div>
<div className={styles.infoItem}>
<Map fill={vars.color.grayscale200} />
<span>{location}</span>
<span>{address}</span>
</div>
<img src={MAP_SAMPLE_IMAGE} alt="맵 샘플 이미지" className={styles.map} />
</div>
Expand Down
12 changes: 6 additions & 6 deletions app/frontend/src/components/MogacoDetail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MogacoProps } from '@/types';

import { DetailContent } from './DetailContent';
import { DetailContents } from './DetailContents';
import { DetailHeader } from './DetailHeader';
import { DetailInfo } from './DetailInfo';
import * as styles from './index.css';
Expand All @@ -20,12 +20,12 @@ export function MogacoDetailPage({
<div className={styles.container}>
<DetailHeader title={title} status={status} />
<DetailInfo
participants={participantList}
maxParticipantsNumber={maxHumanCount}
datetime={date}
location={address}
participantList={participantList}
maxHumanCount={maxHumanCount}
date={date}
address={address}
/>
<DetailContent content={contents} />
<DetailContents contents={contents} />
<hr className={styles.horizontalLine} />
</div>
</div>
Expand Down

0 comments on commit 0cf538e

Please sign in to comment.