33import { useState } from 'react' ;
44import { GoogleMap , Marker , useJsApiLoader } from '@react-google-maps/api' ;
55import Image from 'next/image' ;
6+ import { useSearchParams } from "next/navigation" ;
67
78export default function HomecomingPage ( ) {
89 const [ showInvitation , setShowInvitation ] = useState ( false ) ;
@@ -45,6 +46,12 @@ export default function HomecomingPage() {
4546 Hero 컴포넌트
4647================================ */
4748function Hero ( { onOpenInvitation} ) {
49+ const searchParams = useSearchParams ( ) ;
50+
51+ // 예: /homecoming?from=GOAT+멤버
52+ const rawText = searchParams . get ( 'from' ) ; // 없으면 null
53+ const testText = rawText ? ( decodeURIComponent ( rawText ) + " " ) : '' ; // 기본값 처리
54+
4855 return ( < div className = "flex flex-1 flex-col items-center gap-8 text-center" >
4956 < Image
5057 src = "/images/homecoming/main_img.png"
@@ -55,11 +62,13 @@ function Hero({onOpenInvitation}) {
5562 className = "w-full max-w-2xl mt-[calc(50vh-235px)] md:mt-[100px] md:max-w-[790px]"
5663 />
5764
58-
59- < h1 className = "text-2xl font-extrabold leading-tight text-neutral-900 md:text-4xl lg:text-5xl" >
65+ < h1 className = "text-xl font-extrabold leading-tight text-neutral-900 md:text-4xl lg:text-5xl" >
6066 GDGoC INHA
6167 < br />
62- 제1회 홈커밍데이에 초대합니다!
68+ 제1회 홈커밍데이에
69+ < br />
70+ { testText && ( < > { testText } </ > ) }
71+ 여러분을 초대합니다!
6372 </ h1 >
6473
6574 < button
@@ -223,27 +232,27 @@ function HomecomingMap() {
223232
224233 if ( loadError ) {
225234 return ( < div
226- className = "rounded-2xl border border-red-300 bg-red-50 text-red-700 text-xs md:text-sm flex items-center justify-center h-[220px] md:h-[320px] lg:h-[420px]" >
227- 지도를 불러오는 중 오류가 발생했습니다.
228- </ div > ) ;
235+ className = "rounded-2xl border border-red-300 bg-red-50 text-red-700 text-xs md:text-sm flex items-center justify-center h-[220px] md:h-[320px] lg:h-[420px]" >
236+ 지도를 불러오는 중 오류가 발생했습니다.
237+ </ div > ) ;
229238 }
230239
231240 if ( ! isLoaded ) {
232241 return ( < div
233- className = "rounded-2xl border border-neutral-200 bg-neutral-100 text-neutral-500 text-xs md:text-sm flex items-center justify-center h-[220px] md:h-[320px] lg:h-[420px]" >
234- 지도를 불러오는 중입니다...
235- </ div > ) ;
242+ className = "rounded-2xl border border-neutral-200 bg-neutral-100 text-neutral-500 text-xs md:text-sm flex items-center justify-center h-[220px] md:h-[320px] lg:h-[420px]" >
243+ 지도를 불러오는 중입니다...
244+ </ div > ) ;
236245 }
237246
238247 return ( < div
239- className = "rounded-2xl overflow-hidden border border-neutral-200 bg-neutral-100 h-[220px] md:h-[320px] lg:h-[420px]" >
240- < GoogleMap
241- mapContainerClassName = "w-full h-full"
242- center = { center }
243- zoom = { 17 }
244- options = { { disableDefaultUI : true , clickableIcons : false } }
245- >
246- < Marker position = { center } />
247- </ GoogleMap >
248- </ div > ) ;
248+ className = "rounded-2xl overflow-hidden border border-neutral-200 bg-neutral-100 h-[220px] md:h-[320px] lg:h-[420px]" >
249+ < GoogleMap
250+ mapContainerClassName = "w-full h-full"
251+ center = { center }
252+ zoom = { 17 }
253+ options = { { disableDefaultUI : true , clickableIcons : false } }
254+ >
255+ < Marker position = { center } />
256+ </ GoogleMap >
257+ </ div > ) ;
249258}
0 commit comments