@@ -131,49 +131,65 @@ const ScorePageContent = () => {
131131 }
132132 } , [ isError , isLoading , router ] ) ;
133133
134- if ( isLoading ) {
135- return < CloudSpinnerPage /> ;
136- }
137-
138- if ( searchActive ) {
139- const hotKeyWords = [ "RMIT" , "오스트라바" , "칼스루에" , "그라츠" , "추오" , "프라하" , "보라스" , "빈" , "메모리얼" ] ;
140- return (
141- < >
142- < ScoreSearchBar textRef = { searchRef } searchHandler = { handleSearch } onClick = { ( ) => setSearchActive ( false ) } />
143- < ScoreSearchField keyWords = { hotKeyWords } setKeyWord = { handleSearchField } />
144- </ >
145- ) ;
146- }
134+ const hotKeyWords = [ "RMIT" , "오스트라바" , "칼스루에" , "그라츠" , "추오" , "프라하" , "보라스" , "빈" , "메모리얼" ] ;
147135
148136 return (
149137 < div className = "gap-4 px-5" >
150138 < ScoreSearchBar onClick = { handleSearchClick } textRef = { searchRef } searchHandler = { handleSearch } />
151- < Tab choices = { PREFERENCE_CHOICE } choice = { preference } setChoice = { setPreference } />
152- < ButtonTab
153- choices = { REGIONS_KO }
154- choice = { regionFilter }
155- setChoice = { ( newRegion ) => {
156- if ( searchRef . current ) searchRef . current . value = "" ;
157- setSearchValue ( "" ) ;
158- setRegionFilter ( newRegion as RegionKo | "" ) ;
159- } }
160- style = { { padding : "10px 0 10px 18px" } }
161- />
162-
163- < div className = "mx-auto mt-2.5 flex w-full flex-col gap-3 overflow-x-auto" >
164- { scoreSheets . map ( ( choice ) => (
165- < ScoreSheet key = { choice . koreanName } scoreSheet = { choice } />
166- ) ) }
167- </ div >
168- < ConfirmCancelModal
169- title = "학교 지원이 필요합니다"
170- isOpen = { showNeedApply }
171- handleCancel = { ( ) => router . push ( "/" ) }
172- handleConfirm = { ( ) => router . push ( "/university/application/apply" ) }
173- content = { "점수 공유현황을 확인하려면 지원절차를\n진행해주세요." }
174- cancelText = "확인"
175- approveText = "학교 지원하기"
176- />
139+
140+ { searchActive ? (
141+ < div className = "font-sans p-4" >
142+ { /* Title for the popular searches section */ }
143+ < div className = "ml-5 mt-[18px] text-base font-semibold leading-normal text-black" > 인기 검색</ div >
144+
145+ { /* Container for the keyword buttons */ }
146+ < div className = "ml-5 mt-2.5 flex flex-wrap gap-2" >
147+ { hotKeyWords . map ( ( word ) => (
148+ < button
149+ key = { word }
150+ // Button styling for each keyword
151+ className = "flex items-center justify-center gap-2.5 rounded-full bg-gray-50 px-3 py-[5px] text-sm font-medium leading-[160%] text-black transition-colors hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2"
152+ onClick = { ( ) => {
153+ handleSearchField ( word ) ;
154+ handleSearch ( new Event ( "submit" ) as unknown as React . FormEvent ) ;
155+ } }
156+ type = "button"
157+ >
158+ { word }
159+ </ button >
160+ ) ) }
161+ </ div >
162+ </ div >
163+ ) : (
164+ < >
165+ < Tab choices = { PREFERENCE_CHOICE } choice = { preference } setChoice = { setPreference } />
166+ < ButtonTab
167+ choices = { REGIONS_KO }
168+ choice = { regionFilter }
169+ setChoice = { ( newRegion ) => {
170+ if ( searchRef . current ) searchRef . current . value = "" ;
171+ setSearchValue ( "" ) ;
172+ setRegionFilter ( newRegion as RegionKo | "" ) ;
173+ } }
174+ style = { { padding : "10px 0 10px 18px" } }
175+ />
176+
177+ < div className = "mx-auto mt-2.5 flex w-full flex-col gap-3 overflow-x-auto" >
178+ { scoreSheets . map ( ( choice ) => (
179+ < ScoreSheet key = { choice . koreanName } scoreSheet = { choice } />
180+ ) ) }
181+ </ div >
182+ < ConfirmCancelModal
183+ title = "학교 지원이 필요합니다"
184+ isOpen = { showNeedApply }
185+ handleCancel = { ( ) => router . push ( "/" ) }
186+ handleConfirm = { ( ) => router . push ( "/university/application/apply" ) }
187+ content = { "점수 공유현황을 확인하려면 지원절차를\n진행해주세요." }
188+ cancelText = "확인"
189+ approveText = "학교 지원하기"
190+ />
191+ </ >
192+ ) }
177193 </ div >
178194 ) ;
179195} ;
0 commit comments