From 0cebb7ee0e2f5b7f4c3a20e7189ffe0d5b75a57e Mon Sep 17 00:00:00 2001 From: NAJEONG KIM <73640737+Najeong-Kim@users.noreply.github.com> Date: Mon, 18 Nov 2024 22:28:08 +0900 Subject: [PATCH] feat: update open resort date (#51) --- src/entities/resort/model/model.d.ts | 2 ++ src/widgets/resort-detail/ui/resort-summary.tsx | 6 +++++- src/widgets/resort/lib/getResortStatusText.ts | 15 +++++++++++++++ src/widgets/resort/ui/resort-card.tsx | 13 +++++++++++-- 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 src/widgets/resort/lib/getResortStatusText.ts diff --git a/src/entities/resort/model/model.d.ts b/src/entities/resort/model/model.d.ts index dc9446e..40d22b5 100644 --- a/src/entities/resort/model/model.d.ts +++ b/src/entities/resort/model/model.d.ts @@ -53,6 +53,8 @@ export type Resort = { resortId: number, name: string, status: string, + openingDate: string, + closingDate: string, openSlopes: number, currentWeather: { temperature: number, diff --git a/src/widgets/resort-detail/ui/resort-summary.tsx b/src/widgets/resort-detail/ui/resort-summary.tsx index 474b283..f914978 100644 --- a/src/widgets/resort-detail/ui/resort-summary.tsx +++ b/src/widgets/resort-detail/ui/resort-summary.tsx @@ -1,4 +1,6 @@ import Link from 'next/link'; +// eslint-disable-next-line boundaries/element-types +import { getResortStatusText } from '@/widgets/resort/lib/getResortStatusText'; import WeatherIcon from '@/features/resort/ui/weather-icon'; import VoteDialog from '@/features/resort-detail/ui/vote-dialog'; import type { Resort, Url } from '@/entities/resort'; @@ -12,6 +14,8 @@ import ResortSummaryAction from './resort-summary-action'; const ResortSummary = ({ resortId, name, + status, + openingDate, openSlopes, currentWeather, bus, @@ -35,7 +39,7 @@ const ResortSummary = ({
- {openSlopes ? `운행중인 슬로프 ${openSlopes}개` : '개장일이 곧 공개될 예정이에요'} + {getResortStatusText(status, openingDate, openSlopes)}
{currentWeather.description}
- {openSlopes ? `운행중인 슬로프 ${openSlopes}개` : '개장일이 곧 공개될 예정이에요'} + {getResortStatusText(status, openingDate, openSlopes)}
{currentWeather.description}