Skip to content

Commit

Permalink
feat: 스키장 홈페이지, 셔틀버스 링크 연결 (#22)
Browse files Browse the repository at this point in the history
* feat: Add resort bus and homepage url

* refactor: Delete unused files

* feat: Link resort bus and hompage url
  • Loading branch information
Najeong-Kim authored Aug 20, 2024
1 parent 4bfddc2 commit 4128df3
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 187 deletions.
40 changes: 40 additions & 0 deletions src/entities/discovery/model/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions src/entities/discovery/model/model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export type Discovery = {
name: string;
map: string;
slope: number | null;
url: {
bus: string;
homepage: string;
};
weather: {
weather: Weather;
temperature: number;
Expand Down
156 changes: 0 additions & 156 deletions src/entities/resort/model/constants.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/entities/resort/model/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/entities/resort/model/model.d.ts

This file was deleted.

4 changes: 1 addition & 3 deletions src/widgets/discovery-detail/ui/discovery-summary-action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div
key={name}
className={cn(
'flex cursor-pointer flex-col items-center gap-[7px] text-gray-60 transition-all hover:scale-[1.02] hover:text-main-1'
)}
onClick={onClick}
>
{icon}
<p className={cn('body1-semibold')}>{title}</p>
Expand Down
36 changes: 11 additions & 25 deletions src/widgets/discovery-detail/ui/discovery-summary.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 (
<div className={cn('flex w-full gap-[26px] px-[30px] pb-[34px] pt-[10px]')}>
<Card className={cn('flex h-[123px] flex-1 items-center justify-between pl-[30px] pr-6')}>
Expand Down Expand Up @@ -56,12 +38,16 @@ const DiscoverySummary = ({ name, slope, weather }: Discovery) => {
);
} else {
return (
<DiscoverySummaryAction
<Link
key={action.name}
{...action}
icon={action.name === 'bus' ? <BusIcon /> : <LiftIcon />}
onClick={() => handleAction(action.name)}
/>
href={action.name === 'bus' ? url.bus : url.homepage}
target="_blank"
>
<DiscoverySummaryAction
{...action}
icon={action.name === 'bus' ? <BusIcon /> : <LiftIcon />}
/>
</Link>
);
}
})}
Expand Down

0 comments on commit 4128df3

Please sign in to comment.