Skip to content

Commit c5dd2b6

Browse files
authored
Merge pull request #67 from codeit-2team/feat/64
feat/64 체험 상세페이지 전체 레이아웃 1차완성
2 parents 769a436 + ad939c0 commit c5dd2b6

File tree

21 files changed

+318
-171
lines changed

21 files changed

+318
-171
lines changed

public/assets/svg/location.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
import React from 'react';
2+
import { SvgProps } from '@/types/svgType';
23

3-
const Location = ({ size = 24, color = '#9fa6b2', ...props }) => (
4+
const Location = ({ size = 24, color = '#9fa6b2', className }: SvgProps) => (
45
<svg
56
xmlns='http://www.w3.org/2000/svg'
67
width={size}
78
height={size}
8-
fill={color}
99
viewBox='0 0 24 24'
10-
10+
fill='none'
11+
className={className}
12+
style={{ color }}
1113
>
1214
<path
13-
fill='#121'
15+
fill='currentColor'
1416
d='M9 7.875a1.125 1.125 0 1 0 0-2.25 1.125 1.125 0 0 0 0 2.25'
15-
></path>
17+
/>
1618
<path
17-
fill='#121'
19+
fill='currentColor'
1820
d='M9 1.125c-3.101 0-5.625 2.413-5.625 5.379 0 1.412.644 3.29 1.913 5.582 1.02 1.84 2.2 3.504 2.813 4.332a1.117 1.117 0 0 0 1.8 0c.613-.828 1.793-2.492 2.813-4.332 1.267-2.291 1.911-4.17 1.911-5.582 0-2.966-2.524-5.379-5.625-5.379M9 9a2.25 2.25 0 1 1 0-4.5A2.25 2.25 0 0 1 9 9'
19-
></path>
21+
/>
2022
</svg>
2123
);
2224

public/assets/svg/star.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import { SvgProps } from '@/types/svgType';
3+
4+
const Star = ({ size = 20, color = '#fff', ...props }:SvgProps) => (
5+
<svg
6+
xmlns='http://www.w3.org/2000/svg'
7+
width={size}
8+
height={size}
9+
viewBox='0 0 20 20'
10+
fill={color}
11+
{...props}
12+
>
13+
<path
14+
d='M12.3122 15.0005C12.2069 15.0009 12.1042 14.9681 12.0187 14.9067L7.99966 11.993L3.9806 14.9067C3.89474 14.969 3.79129 15.0024 3.68522 15.002C3.57915 15.0016 3.47595 14.9675 3.39054 14.9046C3.30513 14.8417 3.24193 14.7532 3.21009 14.6521C3.17825 14.5509 3.17942 14.4422 3.21341 14.3417L4.78091 9.69891L0.718413 6.91298C0.630416 6.8527 0.564002 6.76586 0.528872 6.66515C0.493743 6.56444 0.491741 6.45513 0.523158 6.3532C0.554575 6.25127 0.617764 6.16206 0.703494 6.0986C0.789224 6.03514 0.893001 6.00076 0.999663 6.00048H6.01154L7.52404 1.34579C7.55662 1.2453 7.6202 1.15771 7.70564 1.09558C7.79109 1.03346 7.89402 1 7.99966 1C8.10531 1 8.20823 1.03346 8.29368 1.09558C8.37913 1.15771 8.44271 1.2453 8.47529 1.34579L9.98779 6.00204H14.9997C15.1065 6.00199 15.2105 6.03613 15.2964 6.09947C15.3824 6.16281 15.4459 6.25201 15.4775 6.35402C15.5091 6.45603 15.5072 6.56548 15.4721 6.66634C15.437 6.76721 15.3706 6.85419 15.2825 6.91454L11.2184 9.69891L12.785 14.3405C12.8104 14.4156 12.8175 14.4957 12.8058 14.5742C12.7941 14.6526 12.7639 14.7272 12.7177 14.7917C12.6715 14.8561 12.6107 14.9087 12.5401 14.945C12.4696 14.9813 12.3915 15.0003 12.3122 15.0005Z'
15+
fill='#FFC23D'
16+
/>
17+
</svg>
18+
);
19+
20+
export default Star;

src/app/(with-header)/activities/[activitiesId]/components/ImageGrid.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22

33
import Image from 'next/image';
44
import React, { useState } from 'react';
5-
6-
interface ActivityImageProps {
7-
mainImage: string;
8-
subImages: string[];
9-
}
5+
import { ImageGridProps } from '@/types/activityDetailType';
106

117
export default function ImageGrid({
128
mainImage,
139
subImages,
14-
}: ActivityImageProps) {
10+
}: ImageGridProps) {
1511
const images = [mainImage, ...subImages];
1612
const [currentIndex, setCurrentIndex] = useState(0); //캐러셀 구현용 state
1713

src/app/(with-header)/activities/[activitiesId]/components/ReviewCard.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import Avatar from '@/components/Avatar';
2-
3-
interface UserReviewProps {
4-
userName: string;
5-
date: string;
6-
reviewText: string;
7-
avatarSrc: string;
8-
}
2+
import { ReviewCardProps } from '@/types/activityDetailType';
93

104
export default function ReviewCard({
115
userName,
126
date,
137
reviewText,
148
avatarSrc,
15-
}: UserReviewProps) {
9+
}: ReviewCardProps) {
1610
return (
17-
<div className='mx-auto flex max-w-md items-start gap-6 p-6 text-black md:max-w-2xl'>
11+
<div className='flex max-w-md justify-start gap-6 p-6 text-black md:max-w-2xl'>
1812
<Avatar src={avatarSrc} size='sm' />
1913
<div className='grid flex-1 gap-6'>
20-
<div className='flex items-center gap-10 text-sm md:text-lg'>
14+
<div className='flex gap-10 text-sm md:text-lg'>
2115
<p className='font-bold'>{userName}</p>
2216
<p className='text-black'>|</p>
2317
<p className='text-gray-600'>{date}</p>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Star from '@assets/svg/star';
2+
3+
export default function ReviewTitle() {
4+
return (
5+
<div className='mt-10 mb-10 flex flex-col'>
6+
<h2 className='text-2xl font-bold'>후기</h2>
7+
8+
<div className='mt-15 flex items-center gap-15'>
9+
<h2 className='text-4xl font-bold'>4.2</h2>
10+
<div className='flex flex-col gap-10'>
11+
<p>매우 만족</p>
12+
<div className='flex items-center'>
13+
<Star />
14+
<p>1300개 후기</p>
15+
</div>
16+
</div>
17+
</div>
18+
</div>
19+
);
20+
}

src/app/(with-header)/activities/[activitiesId]/components/Title.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
import React from 'react';
22
import IconDropdown from '@assets/svg/dropdown';
3-
4-
interface TitleProps {
5-
title: string;
6-
category: string;
7-
rating: number;
8-
reviewCount: number;
9-
address: string;
10-
isDropDown?: boolean;
11-
}
3+
import Star from '@assets/svg/star';
4+
import { TitleProps } from '@/types/activityDetailType';
125

136
export default function Title({
147
title,
@@ -25,9 +18,9 @@ export default function Title({
2518
<h1 className='mb-2 text-2xl font-bold text-black md:text-3xl'>
2619
{title}
2720
</h1>
28-
<div className='flex items-center gap-4 text-sm text-gray-600'>
21+
<div className='flex items-center gap-10 text-sm text-gray-600'>
2922
<div className='flex items-center gap-1'>
30-
<span className='text-yellow-500'></span>
23+
<Star />
3124
<span className='font-medium'>
3225
{rating.toFixed(1)} ({reviewCount}명)
3326
</span>
@@ -37,7 +30,7 @@ export default function Title({
3730
</div>
3831

3932
{isDropDown && (
40-
<div className='mt-30 flex items-center gap-2'>
33+
<div className='mt-30 flex items-center gap-1'>
4134
<IconDropdown />
4235
</div>
4336
)}

src/app/(with-header)/activities/[activitiesId]/page.tsx

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { mockActivity } from './mock/mock';
44
import Title from './components/Title';
55
import ImageGrid from './components/ImageGrid';
66
import ReviewCard from './components/ReviewCard';
7+
import BookingInterface from '@/components/FloatingBox/BookingInterface';
8+
import LocationMap from '@/components/LocationMap';
9+
import ReviewTitle from './components/ReviewTitle';
710

811
export default function ActivityDetailPage() {
912
const {
@@ -31,18 +34,46 @@ export default function ActivityDetailPage() {
3134
/>
3235
<ImageGrid mainImage={bannerImageUrl} subImages={subImageUrls} />
3336

34-
<div className='mt-8 grid grid-cols-1 gap-8 md:grid-cols-3'>
37+
<div className='mt-86 grid grid-cols-1 gap-15 md:grid-cols-3'>
3538
<div className='md:col-span-2'>
36-
<h2 className='mb-4 border-b pb-2 text-2xl font-bold'>체험 설명</h2>
37-
<p>{description}</p>
39+
<h2 className='mb-4 pb-2 text-2xl font-bold'>체험 설명</h2>
40+
<p className='whitespace-pre-line'>{description}</p>
41+
</div>
42+
<div className='md:row-span-2'>
43+
<BookingInterface />
44+
</div>
45+
46+
<div className='md:col-span-2'>
47+
<h2 className='mb-4 pb-2 text-2xl font-bold'>체험 장소</h2>
48+
<LocationMap address='서울특별시 강남구' />
49+
<ReviewTitle />
50+
<ReviewCard
51+
userName='강지현'
52+
date='2023. 2. 4'
53+
reviewText='전문가가 직접 강사로 참여하기 때문에 어떤 수준의 춤추는 사람도 쉽게 이해할 수 있었습니다. 이번 체험을 거쳐 저의 춤추기 실력은 더욱 향상되었어요.'
54+
avatarSrc='/test/image1.png'
55+
/>
56+
<ReviewCard
57+
userName='강지현'
58+
date='2023. 2. 4'
59+
reviewText='전문가가 직접 강사로 참여하기 때문에 어떤 수준의 춤추는 사람도 쉽게 이해할 수 있었습니다. 이번 체험을 거쳐 저의 춤추기 실력은 더욱 향상되었어요.'
60+
avatarSrc='/test/image1.png'
61+
/>
62+
63+
<ReviewCard
64+
userName='강지현'
65+
date='2023. 2. 4'
66+
reviewText='전문가가 직접 강사로 참여하기 때문에 어떤 수준의 춤추는 사람도 쉽게 이해할 수 있었습니다. 이번 체험을 거쳐 저의 춤추기 실력은 더욱 향상되었어요.'
67+
avatarSrc='/test/image1.png'
68+
/>
69+
<ReviewCard
70+
userName='강지현'
71+
date='2023. 2. 4'
72+
reviewText='전문가가 직접 강사로 참여하기 때문에 어떤 수준의 춤추는 사람도 쉽게 이해할 수 있었습니다. 이번 체험을 거쳐 저의 춤추기 실력은 더욱 향상되었어요.'
73+
avatarSrc='/test/image1.png'
74+
/>
3875
</div>
3976
</div>
40-
<ReviewCard
41-
userName='강지현'
42-
date='2023. 2. 4'
43-
reviewText='전문가가 직접 강사로 참여하기 때문에 어떤 수준의 춤추는 사람도 쉽게 이해할 수 있었습니다. 이번 체험을 거쳐 저의 춤추기 실력은 더욱 향상되었어요.'
44-
avatarSrc='/test/image1.png'
45-
/>
4677
</div>
4778
);
4879
}

src/components/DatePicker/CalendarBody.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
import type dayjs from 'dayjs';
44

5-
interface CalendarBodyProps {
6-
viewDate: dayjs.Dayjs;
7-
today: dayjs.Dayjs;
8-
selectedDate: dayjs.Dayjs;
9-
onSelectDate: (date: dayjs.Dayjs) => void;
10-
highlightDates?: dayjs.Dayjs[];
11-
}
5+
import { CalendarBodyProps } from '@/types/datePickerTypes';
126

137
export default function CalendarBody({
148
viewDate,

src/components/DatePicker/CalendarHeader.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
'use client';
22

3-
import type dayjs from 'dayjs';
4-
5-
interface CalendarHeaderProps {
6-
viewDate: dayjs.Dayjs;
7-
onMonthChange: (direction: 'add' | 'subtract') => void;
8-
}
3+
import { CalendarHeaderProps } from '@/types/datePickerTypes';
94

105
export default function CalendarHeader({
116
viewDate,

src/components/DatePicker/DatePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function DatePicker() {
5454
const highlightDates = availableDates.map((item) => dayjs(item.date));
5555

5656
return (
57-
<div className='w-full max-w-md rounded-2xl bg-white p-6'>
57+
<div className='max-h-[746px] w-full max-w-md rounded-2xl bg-white p-6'>
5858
<CalendarHeader viewDate={viewDate} onMonthChange={changeMonth} />
5959
<CalendarBody
6060
viewDate={viewDate}

0 commit comments

Comments
 (0)