Skip to content

Commit bbf02b1

Browse files
authored
Merge pull request #120 from WithTime12/develop
[Deploy] 배포
2 parents bc8a580 + 69c312d commit bbf02b1

2 files changed

Lines changed: 35 additions & 21 deletions

File tree

src/components/dateCourse/info.tsx

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,41 @@ type TMealKey = keyof typeof Meal;
1616
const isBudgetKey = (v: string): v is TBudgetKey => Object.prototype.hasOwnProperty.call(Budget, v);
1717
const isTotalTimeKey = (v: string): v is TTotalTimeKey => Object.prototype.hasOwnProperty.call(TotalTime, v);
1818
const isMealKey = (v: string): v is TMealKey => Object.prototype.hasOwnProperty.call(Meal, v);
19+
1920
export default function Info({ cashTag, locationTag, timeTag, MealTag, keywordTags }: TInfo) {
20-
const label = isBudgetKey(cashTag) ? Budget[cashTag] : '알 수 없음';
21-
const totalTime = isTotalTimeKey(timeTag) ? TotalTime[timeTag] : '알 수 없음';
22-
const meals = MealTag.filter(isMealKey).map((tag) => Meal[tag]);
21+
const label = cashTag != null && isBudgetKey(cashTag) ? Budget[cashTag] : '알 수 없음';
22+
const totalTime = timeTag != null && isTotalTimeKey(timeTag) ? TotalTime[timeTag] : '알 수 없음';
23+
const meals = MealTag !== null && MealTag.filter(isMealKey).map((tag) => Meal[tag]);
2324

2425
return (
2526
<div className="w-full gap-[24px] flex flex-col">
26-
<InfoElement title="예산" tags={label}>
27-
<Cash stroke="#000000" />
28-
</InfoElement>
29-
<InfoElement title="장소" tags={locationTag}>
30-
<Location stroke="#000000" />
31-
</InfoElement>
32-
<InfoElement title="총 시간" tags={totalTime}>
33-
<Alarm stroke="#000000" />
34-
</InfoElement>
35-
36-
<InfoElement title="식사 구성" tags={meals}>
37-
<Spoon fill="#000000" />
38-
</InfoElement>
39-
40-
<InfoElement title="키워드" tags={keywordTags}>
41-
<Blub stroke="#000000" />
42-
</InfoElement>
27+
{cashTag && (
28+
<InfoElement title="예산" tags={label}>
29+
<Cash stroke="#000000" />
30+
</InfoElement>
31+
)}
32+
{locationTag && (
33+
<InfoElement title="장소" tags={locationTag}>
34+
<Location stroke="#000000" />
35+
</InfoElement>
36+
)}
37+
{timeTag && (
38+
<InfoElement title="총 시간" tags={totalTime}>
39+
<Alarm stroke="#000000" />
40+
</InfoElement>
41+
)}
42+
43+
{meals && (
44+
<InfoElement title="식사 구성" tags={meals}>
45+
<Spoon fill="#000000" />
46+
</InfoElement>
47+
)}
48+
49+
{keywordTags && (
50+
<InfoElement title="키워드" tags={keywordTags}>
51+
<Blub stroke="#000000" />
52+
</InfoElement>
53+
)}
4354
</div>
4455
);
4556
}

src/components/dateCourse/timeline.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import Location from '@/assets/icons/Location_Blank.svg?react';
1212

1313
function Timeline({ end = false, image, name, placeCategoryResponseList, roadNameAddress, averagePrice, time, signatureDish }: TTimeline) {
1414
const [open, setOpen] = useState(false);
15+
const editTime = time != null ? time.split(':')[0] : '00';
16+
const editMin = time != null ? time.split(':')[1] : '00';
17+
1518
return (
1619
<div className="flex w-full gap-2 flex-col">
1720
<div
@@ -20,7 +23,7 @@ function Timeline({ end = false, image, name, placeCategoryResponseList, roadNam
2023
onClick={() => (end ? undefined : setOpen(!open))}
2124
>
2225
<div className="flex items-center h-full font-body2 select-none">
23-
{time.split(':')[0]}:{time.split(':')[1]}
26+
{editTime}:{editMin}
2427
</div>
2528
<div className="flex flex-1 h-full justify-center items-center">
2629
<div className="rounded-full w-[5px] h-[5px] bg-default-gray-700" />

0 commit comments

Comments
 (0)