@@ -33,7 +33,7 @@ export default function Page() {
3333 }
3434
3535 return midpointData . data . map ( ( midpoint , index ) => {
36- const { endStation, endStationLine, userRoutes } = midpoint ;
36+ const { endStation, endStationLine, userRoutes, hot } = midpoint ;
3737
3838 const routesWithColor = userRoutes . map ( ( route ) => {
3939 return {
@@ -107,18 +107,52 @@ export default function Page() {
107107 transferPath : myRoute ?. transferPath || [ ] ,
108108 transferPathLines,
109109 userRoutes : routesWithColor ,
110+ hot,
110111 } ;
111112 } ) ;
112113 } , [ midpointData , myNickname , id ] ) ;
113114
114115 // 카테고리 텍스트 생성 함수
115- const getCategoryText = ( category : string | undefined ) : string => {
116- if ( ! category ) return '밍글링 추천 1위' ;
116+ const getCategoryText = (
117+ category : string | undefined ,
118+ hot : boolean | undefined ,
119+ rank : number ,
120+ ) : string => {
121+ const purposeText = '[모임 목적]' ;
122+ const lastChar = purposeText . charCodeAt ( purposeText . length - 1 ) ;
123+ const hasJongseong = ( lastChar - 0xac00 ) % 28 !== 0 ;
124+ const purposeTextWithPostfix = `${ purposeText } ${ hasJongseong ? '이' : '가' } 많은 장소` ;
125+
126+
127+ if ( hot === true && rank === 1 ) {
128+ return `밍글링 추천 1위 · ${ purposeTextWithPostfix } ` ;
129+ }
130+
131+
132+ else if ( hot === true && rank === 2 ) {
133+ return `밍글링 추천 2위 · ${ purposeTextWithPostfix } ` ;
134+ }
135+
136+
137+ else if ( hot === true ) {
138+ return purposeTextWithPostfix ;
139+ }
140+
141+
142+ else if ( rank === 1 ) {
143+ return '밍글링 추천 1위' ;
144+ }
145+
146+ else if ( rank === 2 ) {
147+ return '밍글링 추천 2위' ;
148+ }
149+
150+ else if ( ! category ) return '밍글링 추천 1위' ;
117151
118152 // 카테고리 종성에 따라 "이/가"를 다르게 렌더링
119- const lastChar = category . charCodeAt ( category . length - 1 ) ;
120- const hasJongseong = ( lastChar - 0xac00 ) % 28 !== 0 ;
121- return `${ category } ${ hasJongseong ? '이' : '가' } 많은 장소` ;
153+ const categoryLastChar = category . charCodeAt ( category . length - 1 ) ;
154+ const categoryHasJongseong = ( categoryLastChar - 0xac00 ) % 28 !== 0 ;
155+ return `${ category } ${ categoryHasJongseong ? '이' : '가' } 많은 장소` ;
122156 } ;
123157
124158 const [ selectedResultId , setSelectedResultId ] = useState < number > ( 1 ) ;
@@ -151,7 +185,7 @@ export default function Page() {
151185 < >
152186 < section className = "border-gray-1 flex w-full flex-col gap-5 bg-white md:w-77.5 md:gap-3" >
153187 < div className = "px-5 pt-5 md:p-0" >
154- < div className = "flex items-center justify-between " >
188+ < div className = "flex items-center gap-3 " >
155189 < button
156190 onClick = { handleModifyStart }
157191 className = "flex items-center justify-center"
@@ -162,14 +196,7 @@ export default function Page() {
162196 < div className = "text-gray-9 text-[22px] font-semibold tracking-[-1.94%]" >
163197 최종 위치 결과 Top3
164198 </ div >
165- < button
166- className = "text-blue-5 bg-blue-1 hover:bg-blue-2 flex h-7 cursor-pointer items-center gap-1 rounded px-2.5 text-[11px] font-semibold transition-colors"
167- type = "button"
168- onClick = { ( e ) => openModal ( 'SHARE' , { meetingId : id } , e ) }
169- >
170- < Image src = "/icon/share.svg" alt = "공유 아이콘" width = { 12 } height = { 12 } />
171- 결과 공유하기
172- </ button >
199+
173200 </ div >
174201 </ div >
175202
@@ -207,7 +234,7 @@ export default function Page() {
207234 locationResults . map ( ( result ) => {
208235 const category =
209236 meetingData ?. data ?. purposes ?. [ meetingData . data . purposes . length - 1 ] ;
210- const categoryText = getCategoryText ( category ) ;
237+ const categoryText = getCategoryText ( category , result . hot , result . id ) ;
211238
212239 const handleRecommendClick = ( e : React . MouseEvent ) => {
213240 e . stopPropagation ( ) ;
@@ -309,12 +336,13 @@ export default function Page() {
309336 ) }
310337 </ div >
311338 </ div >
312-
339+
313340 < button
314- onClick = { handleModifyStart }
315- className = "bg-blue-5 hover:bg-blue-8 absolute right-5 bottom-0 left-5 h-12 rounded text-lg font-semibold text-white transition-transform active:scale-[0.98] md:right-0 md:left-0"
341+ onClick = { ( e ) => openModal ( 'SHARE' , { meetingId : id } , e ) }
342+ className = "flex items-center justify-center gap-2.5 bg-blue-5 hover:bg-blue-8 absolute right-5 bottom-0 left-5 h-12 rounded text-lg font-semibold text-white transition-transform active:scale-[0.98] md:right-0 md:left-0"
316343 >
317- 내 출발지 수정하기
344+ < Image src = "/icon/share-white.svg" alt = "공유 아이콘" width = { 20 } height = { 20 } />
345+ 결과 공유하기
318346 </ button >
319347 </ div >
320348 </ section >
0 commit comments