1
1
import IconBed from "@assets/icons/ic_bed.svg?react" ;
2
2
import IconCaretRight from "@assets/icons/ic_caret_right.svg?react" ;
3
+ import IconChat from "@assets/icons/ic_chat-fill.svg?react" ;
4
+ import IconMapPin from "@assets/icons/ic_map-pin.svg?react" ;
5
+ import IconStar from "@assets/icons/ic_star-fill.svg?react" ;
3
6
import IconUser from "@assets/icons/ic_users.svg?react" ;
4
7
import RoomThemeOption from "@pages/roomDetailPage/components/roomThemeOption/RoomThemeOption" ;
5
8
import * as S from "@pages/roomDetailPage/RoomDetail.style" ;
9
+ import { formatDateAndTime } from "@utils/dateFormatter" ;
6
10
7
11
import type { RoomData } from "@type/room" ;
8
- import { formatDate } from "@utils/dateFormatter" ;
12
+
13
+ import Tag from "@/components/tag/Tag" ;
14
+ import { useLocation } from "react-router-dom" ;
15
+ import ExpandableContent from "./ExpandableContent" ;
9
16
10
17
interface RoomInfoProps {
11
18
room : RoomData ;
12
19
discount : string ;
13
20
}
14
21
15
22
const RoomInfo = ( { room, discount } : RoomInfoProps ) => {
16
- const checkInDate = formatDate ( room . checkIn ) ;
17
- const checkOutDate = formatDate ( room . checkOut ) ;
23
+ const location = useLocation ( ) ;
24
+ const { pathname } = location ;
25
+
26
+ const checkInDate = formatDateAndTime ( room . checkIn ) ;
27
+ const checkOutDate = formatDateAndTime ( room . checkOut ) ;
28
+
29
+ const params = new URLSearchParams ( ) ;
30
+ params . append ( "address" , room . hotelAddress ) ;
31
+
18
32
return (
19
33
< >
20
34
< S . DetailSection >
21
- < S . HStack5 >
22
- < S . HStack1 >
23
- < S . Text variant = "title2" > { room . hotelName } </ S . Text >
24
- < S . Text variant = "body3" > { room . roomName } </ S . Text >
25
- </ S . HStack1 >
26
- < S . Col >
27
- < S . ItemWrapper >
28
- < S . Text > 정가</ S . Text >
29
- < S . Text color = "greyScale3" >
30
- < s > { room . originalPrice . toLocaleString ( ) } 원</ s >
31
- </ S . Text >
32
- </ S . ItemWrapper >
33
- < S . ItemWrapper >
34
- < S . Text > 판매가</ S . Text >
35
- < S . Row >
36
- < S . Text variant = "title2" color = "percentBlue" >
37
- { discount } %
38
- </ S . Text >
39
- < S . Text variant = "title2" >
40
- { room . sellingPrice . toLocaleString ( ) } 원
41
- </ S . Text >
42
- </ S . Row >
43
- </ S . ItemWrapper >
44
- </ S . Col >
45
- < S . VStack1 >
46
- < S . LeftBox >
47
- < S . Text variant = "body3" color = "greyScale1" >
48
- 체크인
35
+ < S . HStack1 >
36
+ < S . Row1 >
37
+ < IconStar />
38
+ < S . Text variant = "body3" >
39
+ { room . roomAllRating + " · " + room . hotelLevel }
40
+ </ S . Text >
41
+ </ S . Row1 >
42
+ < S . Text variant = "title2" > { room . hotelName } </ S . Text >
43
+ < S . Text variant = "body2" > { room . roomName } </ S . Text >
44
+ </ S . HStack1 >
45
+
46
+ < S . MapWrapper >
47
+ < S . MapLink to = { pathname + "/map?" + params } >
48
+ < IconMapPin />
49
+ < S . Text variant = "body4" > { room . hotelAddress } </ S . Text >
50
+ < S . IconArrow />
51
+ </ S . MapLink >
52
+ </ S . MapWrapper >
53
+
54
+ < S . VStack1 >
55
+ < S . LeftBox >
56
+ < S . Text variant = "body3" color = "greyScale3" >
57
+ 체크인
58
+ </ S . Text >
59
+ < S . Text variant = "body2" >
60
+ { checkInDate . date }
61
+ < br />
62
+ { checkInDate . time }
63
+ </ S . Text >
64
+ </ S . LeftBox >
65
+ < S . RightBox >
66
+ < S . Text variant = "body3" color = "greyScale3" >
67
+ 체크아웃
68
+ </ S . Text >
69
+ < S . Text variant = "body2" >
70
+ { checkOutDate . date }
71
+ < br />
72
+ { checkOutDate . time }
73
+ </ S . Text >
74
+ </ S . RightBox >
75
+ </ S . VStack1 >
76
+
77
+ < S . Col >
78
+ < S . ItemWrapper >
79
+ < S . Text > 야놀자 정가</ S . Text >
80
+ < S . Row >
81
+ < S . Text variant = "button4" color = "percentBlue" >
82
+ { discount } %
49
83
</ S . Text >
50
- < S . Text variant = "body3" > { checkInDate } </ S . Text >
51
- </ S . LeftBox >
52
- < S . RightBox >
53
- < S . Text variant = "body3" color = "greyScale1" >
54
- 체크아웃
84
+ < S . Text variant = "body4" color = "greyScale3" >
85
+ < s > { room . originalPrice . toLocaleString ( ) } 원</ s >
55
86
</ S . Text >
56
- < S . Text variant = "body3" > { checkOutDate } </ S . Text >
57
- </ S . RightBox >
58
- </ S . VStack1 >
59
- </ S . HStack5 >
87
+ </ S . Row >
88
+ </ S . ItemWrapper >
89
+ < S . ItemWrapper >
90
+ < S . Text > 거래 희망가</ S . Text >
91
+ < S . Text variant = "title2" >
92
+ { room . sellingPrice . toLocaleString ( ) } 원
93
+ </ S . Text >
94
+ </ S . ItemWrapper >
95
+ </ S . Col >
60
96
</ S . DetailSection >
61
97
98
+ { room . sellerCommentList && (
99
+ < S . DetailSection >
100
+ < S . VStack3 >
101
+ < S . Row >
102
+ < IconChat />
103
+ < S . Text variant = "body2" > 판매자 코멘트</ S . Text >
104
+ </ S . Row >
105
+ < ExpandableContent >
106
+ { room . sellerCommentList . map ( ( item , index ) => (
107
+ < Tag key = { index } > { item } </ Tag >
108
+ ) ) }
109
+ </ ExpandableContent >
110
+ </ S . VStack3 >
111
+ </ S . DetailSection >
112
+ ) }
113
+
62
114
< S . DetailSection >
63
115
< S . HStack5 >
64
116
< S . HStack1 >
65
117
< S . Text variant = "body3" > 기본 정보</ S . Text >
66
118
< S . VStack5 >
67
119
< S . Row >
68
120
< IconUser />
69
- < S . Text variant = "body3 " >
121
+ < S . Text variant = "body4" color = "greyScale2 ">
70
122
기준 { room . standardPeople } 인 / 최대 { room . maxPeople } 인
71
123
</ S . Text >
72
124
</ S . Row >
73
125
< S . Row >
74
126
< IconBed />
75
- < S . Text variant = "body3 " > { room . bedType } </ S . Text >
127
+ < S . Text variant = "body4 " > { room . bedType } </ S . Text >
76
128
</ S . Row >
77
129
</ S . VStack5 >
78
130
</ S . HStack1 >
@@ -81,8 +133,12 @@ const RoomInfo = ({ room, discount }: RoomInfoProps) => {
81
133
< RoomThemeOption option = { room . roomTheme } />
82
134
</ S . HStack1 >
83
135
< S . HStack1 >
84
- < S . Text variant = "body3" > 위치 정보</ S . Text >
85
- < S . Text variant = "body3" > { room . hotelAddress } </ S . Text >
136
+ < S . Text variant = "body3" > 추가 정보</ S . Text >
137
+ < S . VStack5 >
138
+ < S . Text variant = "body4" color = "greyScale2" >
139
+ { room . facilityInformation }
140
+ </ S . Text >
141
+ </ S . VStack5 >
86
142
</ S . HStack1 >
87
143
< a
88
144
href = { room . hotelInfoUrl }
@@ -91,8 +147,12 @@ const RoomInfo = ({ room, discount }: RoomInfoProps) => {
91
147
aria-label = "상세 정보 보기"
92
148
>
93
149
< S . MoreInfoWrapper >
94
- < S . Text variant = "button2" color = "greyScale1" >
95
- 상세 정보 보기
150
+ < S . Text
151
+ className = "underline"
152
+ variant = "caption3"
153
+ color = "greyScale1"
154
+ >
155
+ 상세 정보 보러가기
96
156
</ S . Text >
97
157
< IconCaretRight />
98
158
</ S . MoreInfoWrapper >
0 commit comments