From 4128df3a6ccd8fe7248b602ada270ac7a4ff48c8 Mon Sep 17 00:00:00 2001 From: NAJEONG KIM <73640737+Najeong-Kim@users.noreply.github.com> Date: Tue, 20 Aug 2024 22:48:46 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=8A=A4=ED=82=A4=EC=9E=A5=20=ED=99=88?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80,=20=EC=85=94=ED=8B=80=EB=B2=84?= =?UTF-8?q?=EC=8A=A4=20=EB=A7=81=ED=81=AC=20=EC=97=B0=EA=B2=B0=20(#22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add resort bus and homepage url * refactor: Delete unused files * feat: Link resort bus and hompage url --- src/entities/discovery/model/constants.ts | 40 +++++ src/entities/discovery/model/model.d.ts | 4 + src/entities/resort/model/constants.ts | 156 ------------------ src/entities/resort/model/index.ts | 2 - src/entities/resort/model/model.d.ts | 1 - .../ui/discovery-summary-action.tsx | 4 +- .../discovery-detail/ui/discovery-summary.tsx | 36 ++-- 7 files changed, 56 insertions(+), 187 deletions(-) delete mode 100644 src/entities/resort/model/constants.ts delete mode 100644 src/entities/resort/model/index.ts delete mode 100644 src/entities/resort/model/model.d.ts diff --git a/src/entities/discovery/model/constants.ts b/src/entities/discovery/model/constants.ts index 40d1ede..dae18dc 100644 --- a/src/entities/discovery/model/constants.ts +++ b/src/entities/discovery/model/constants.ts @@ -73,6 +73,10 @@ export const DiscoveryData: Discovery[] = [ name: '용평스키장 모나', map: 'yongpyong', slope: null, + url: { + bus: 'https://skibus.purplebus.co.kr/Yp/', + homepage: 'https://www.yongpyong.co.kr/kor/skiNboard/introduce.do', + }, weather: { weather: 'sun', temperature: -5, @@ -85,6 +89,10 @@ export const DiscoveryData: Discovery[] = [ name: '지산 리조트', map: 'jisan', slope: 8, + url: { + bus: 'https://www.jisanresort.co.kr/w/reservation/shuttle/reservation.asp', + homepage: 'https://www.jisanresort.co.kr/m/ski/', + }, weather: { weather: 'cloud', temperature: -3, @@ -97,6 +105,10 @@ export const DiscoveryData: Discovery[] = [ name: '에덴밸리 리조트', map: 'eden', slope: 10, + url: { + bus: 'http://m.newbusantour.co.kr/goods/goods_detail.asp?g_cd=2183', + homepage: 'https://www.edenvalley.co.kr/ski/View.asp?location=01', + }, weather: { weather: 'rain', temperature: -4, @@ -109,6 +121,10 @@ export const DiscoveryData: Discovery[] = [ name: '웰리힐리파크', map: 'wellihilli', slope: 10, + url: { + bus: 'https://www.wellihillipark.com/home/guide/map/shuttle', + homepage: 'https://www.wellihillipark.com/snowpark', + }, weather: { weather: 'rain', temperature: -4, @@ -121,6 +137,10 @@ export const DiscoveryData: Discovery[] = [ name: '하이원스키장', map: 'high1', slope: 10, + url: { + bus: 'https://skibus.purplebus.co.kr/Hi/', + homepage: 'https://www.high1.com/ski/index.do', + }, weather: { weather: 'rain', temperature: -4, @@ -133,6 +153,10 @@ export const DiscoveryData: Discovery[] = [ name: '곤지암스키장', map: 'gonjiam', slope: 10, + url: { + bus: 'https://m.konjiamresort.co.kr/ski/pickupService.dev', + homepage: 'https://www.konjiamresort.co.kr/main.dev', + }, weather: { weather: 'rain', temperature: -4, @@ -145,6 +169,10 @@ export const DiscoveryData: Discovery[] = [ name: '비발디파크', map: 'vivaldipark', slope: 10, + url: { + bus: 'https://www.busline.co.kr/busline_22K28/reservation_input.html?title=%EB%85%B8%EC%84%A0%EC%84%A0%ED%83%9D%20%EB%B0%8F%20%EC%9D%B4%EC%9A%A9%EC%9E%90%EB%93%B1%EB%A1%9D', + homepage: 'https://www.sonohotelsresorts.com/complex_vp', + }, weather: { weather: 'rain', temperature: -4, @@ -157,6 +185,10 @@ export const DiscoveryData: Discovery[] = [ name: '엘리시안 강촌', map: 'elysian-gangchon', slope: 10, + url: { + bus: 'https://gs.elysian.co.kr/gangchon/enjoyElysian/roadMap_free_230210_pop.asp', + homepage: 'https://www.elysian.co.kr/', + }, weather: { weather: 'rain', temperature: -4, @@ -169,6 +201,10 @@ export const DiscoveryData: Discovery[] = [ name: '무주리조트 덕유산', map: 'muju', slope: 10, + url: { + bus: 'https://www.mdysresort.com/guide/shuttle_bus.asp', + homepage: 'https://www.mdysresort.com/index.asp', + }, weather: { weather: 'rain', temperature: -4, @@ -181,6 +217,10 @@ export const DiscoveryData: Discovery[] = [ name: '휘닉스파크', map: 'phoenix', slope: 10, + url: { + bus: 'https://skibus.purplebus.co.kr/Pp/', + homepage: 'https://phoenixhnr.co.kr/page/main/pyeongchang?q%5BhmpgDivCd%5D=PP&page=1&size=4', + }, weather: { weather: 'rain', temperature: -4, diff --git a/src/entities/discovery/model/model.d.ts b/src/entities/discovery/model/model.d.ts index 1711ee4..f74e89e 100644 --- a/src/entities/discovery/model/model.d.ts +++ b/src/entities/discovery/model/model.d.ts @@ -14,6 +14,10 @@ export type Discovery = { name: string; map: string; slope: number | null; + url: { + bus: string; + homepage: string; + }; weather: { weather: Weather; temperature: number; diff --git a/src/entities/resort/model/constants.ts b/src/entities/resort/model/constants.ts deleted file mode 100644 index aa439e1..0000000 --- a/src/entities/resort/model/constants.ts +++ /dev/null @@ -1,156 +0,0 @@ -export const ResortList = [ - { - name: '곤지암리조트 스키장', - tag: 'konjiam', - map: 'konjiam.jpg', - weather: 24, - temperature: 21, - congestion: '다소 혼잡해요', - spots: [ - { - tag: 'top', - name: '정상 휴게소', - level: '중급', - isAvailable: true, - }, - { - tag: 'top-slope', - name: '정상부 슬로프', - level: '상급', - isAvailable: true, - }, - { - tag: 'middle-slope', - name: '중간 슬로프', - level: '중급', - isAvailable: false, - }, - { - tag: 'beginner-base', - name: '초중급 베이스', - level: '초급', - isAvailable: true, - }, - { - tag: 'intermediate-base', - name: '중상급 베이스', - level: '중급', - isAvailable: true, - }, - ], - }, - { - name: '용평스키장 모나', - tag: 'yongpyong', - map: 'yongpyong.png', - weather: 21, - temperature: 18, - congestion: '원활해요', - spots: [ - { - tag: 'entrance', - name: '모나 용평 진입로', - level: '', - isAvailable: true, - }, - { - tag: 'forest', - name: '발왕산 천년주목숲길(동쪽)', - level: '', - isAvailable: true, - }, - { - tag: 'red-slope', - name: '베이스전경 / 레드 슬로프', - level: '', - isAvailable: true, - }, - { - tag: 'sky-walk', - name: '발왕산 氣 스카이워크', - level: '', - isAvailable: true, - }, - { - tag: 'starlight', - name: '별이 빛나는 밤에', - level: '', - isAvailable: true, - }, - { - tag: 'yellow-slope', - name: '옐로우 슬로프 / 용평루지', - level: '', - isAvailable: true, - }, - ], - }, - { - name: '휘닉스파크', - tag: 'phoenix', - map: 'phoenix.png', - weather: 26, - temperature: 24, - congestion: '혼잡해요', - spots: [ - { - tag: 'phoenix', - name: '휘닉스CC', - level: '', - isAvailable: false, - }, - { - tag: 'taegi', - name: '태기산CC', - level: '', - isAvailable: true, - }, - { - tag: 'luge', - name: '루지랜드', - level: '', - isAvailable: true, - }, - { - tag: 'montblanc', - name: '몽블랑광장', - level: '', - isAvailable: true, - }, - ], - }, - { - name: '비발디파크 소노벨', - tag: 'vivaldi', - map: 'vivaldi.png', - weather: 23, - temperature: 19, - congestion: '다소 혼잡해요', - spots: [ - { - tag: 'rock', - name: '락', - level: '최상급', - isAvailable: false, - }, - { - tag: 'techno', - name: '테크노', - level: '상급', - isAvailable: false, - }, - { - tag: 'classic', - name: '클래식', - level: '중상급', - isAvailable: false, - }, - { - tag: 'ballad', - name: '발라드', - level: '초급', - isAvailable: false, - }, - ], - }, -]; diff --git a/src/entities/resort/model/index.ts b/src/entities/resort/model/index.ts deleted file mode 100644 index 0fcc6a6..0000000 --- a/src/entities/resort/model/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { ResortList } from './constants'; -export { type Spot } from './model'; diff --git a/src/entities/resort/model/model.d.ts b/src/entities/resort/model/model.d.ts deleted file mode 100644 index 14a0a3e..0000000 --- a/src/entities/resort/model/model.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type Spot = ExcludeArray<(typeof ResortList)[0]['spots']>; diff --git a/src/widgets/discovery-detail/ui/discovery-summary-action.tsx b/src/widgets/discovery-detail/ui/discovery-summary-action.tsx index 347b1f2..1602672 100644 --- a/src/widgets/discovery-detail/ui/discovery-summary-action.tsx +++ b/src/widgets/discovery-detail/ui/discovery-summary-action.tsx @@ -4,17 +4,15 @@ interface DiscoverySummaryActionProps { name: string; title: string; icon: React.ReactNode; - onClick?: () => void; } -const DiscoverySummaryAction = ({ name, title, icon, onClick }: DiscoverySummaryActionProps) => { +const DiscoverySummaryAction = ({ name, title, icon }: DiscoverySummaryActionProps) => { return (
{icon}

{title}

diff --git a/src/widgets/discovery-detail/ui/discovery-summary.tsx b/src/widgets/discovery-detail/ui/discovery-summary.tsx index 3ad492d..841468a 100644 --- a/src/widgets/discovery-detail/ui/discovery-summary.tsx +++ b/src/widgets/discovery-detail/ui/discovery-summary.tsx @@ -1,4 +1,4 @@ -import { useCallback } from 'react'; +import Link from 'next/link'; import WeatherIcon from '@/features/discovery/ui/weather-icon'; import VoteDialog from '@/features/discovery-detail/ui/vote-dialog'; import type { Discovery } from '@/entities/discovery'; @@ -8,25 +8,7 @@ import Card from '@/shared/ui/card'; import { DiscoverySummaryActionList } from '../model/constants'; import DiscoverySummaryAction from './discovery-summary-action'; -const DiscoverySummary = ({ name, slope, weather }: Discovery) => { - const handleAction = useCallback( - (action: (typeof DiscoverySummaryActionList)[number]['name']) => { - switch (action) { - case 'bus': - console.log('셔틀버스'); - break; - case 'homepage': - console.log('홈페이지'); - break; - case 'vote': - break; - default: - break; - } - }, - [] - ); - +const DiscoverySummary = ({ name, slope, url, weather }: Discovery) => { return (
@@ -56,12 +38,16 @@ const DiscoverySummary = ({ name, slope, weather }: Discovery) => { ); } else { return ( - : } - onClick={() => handleAction(action.name)} - /> + href={action.name === 'bus' ? url.bus : url.homepage} + target="_blank" + > + : } + /> + ); } })}