@@ -10,7 +10,6 @@ import clsx from 'clsx';
1010import type { StatsInfo } from '../../../../src/fetches/github' ;
1111import { fetchGithubStats } from '../../../../src/fetches/github' ;
1212import type { Translates } from '../../../../src/localization' ;
13- import Button from '../../(common)/Button' ;
1413import ButtonGroup from '../../(common)/ButtonGroup' ;
1514import Dropdown from '../../(common)/Dropdown' ;
1615import TextInput from '../../(common)/TextInput' ;
@@ -158,63 +157,61 @@ function Hero({t, statsInfo}: Props): ReactElement {
158157 >
159158 < div
160159 className = { clsx (
161- 'rounded-[16px] px-3 h-[64px] relative body2 w-full' ,
162- 'flex flex-row-reverse items-center' ,
160+ 'rounded-[16px] px-3 h-[64px] body2 w-full' ,
161+ 'flex flex-row items-center gap-2 ' ,
163162 'bg-white/50 dark:bg-black/40' ,
164163 'backdrop-blur-2xl' ,
165164 'border border-black/10 dark:border-white/20' ,
166165 'shadow-[0_20px_60px_-15px_rgba(0,0,0,0.2)]' ,
167166 'hover:bg-white/60 dark:hover:bg-black/50' ,
168167 'transition-all duration-300' ,
169- 'max-[425px]:p-3 max-[425px]:self-stretch max-[425px]:h-auto max-[425px]:flex-wrap' ,
170- 'max-[320px]:py-3 max-[320px]:items-start' ,
168+ 'max-[425px]:px-2 max-[425px]:h-[56px]' ,
171169 ) }
172170 >
173- < Button
174- loading = { formState . isSubmitting }
175- type = "submit"
171+ < Dropdown
172+ data = { statTypes }
173+ selected = { selectedPluginType }
174+ setSelected = { ( el ) => {
175+ setSelectedPluginType ( el ) ;
176+ } }
177+ />
178+ < span
176179 className = { clsx (
177- 'bg-transparent border-0 text-center max-w-[100px] p-2' ,
178- 'absolute' ,
180+ 'text-gray5 dark:text-gray3' ,
181+ 'body3 text-[22px]' ,
182+ 'max-[480px]:hidden' ,
179183 ) }
180- text = { < SearchIcon size = { 22 } className = "text-gray8 dark:text-white" /> }
184+ >
185+ /
186+ </ span >
187+ < TextInput
188+ className = "text-gray7 dark:text-white placeholder:text-gray5 dark:placeholder:text-gray4"
189+ placeholder = { t . githubUsername }
190+ value = { login }
191+ onChange = { ( e ) => {
192+ setLogin ( e . target . value . trim ( ) ) ;
193+ } }
194+ onFocus = { ( ) => setShowHistory ( true ) }
195+ onBlur = { ( ) => {
196+ // Delay to allow click on history items
197+ setTimeout ( ( ) => setShowHistory ( false ) , 200 ) ;
198+ } }
181199 />
182- < div
200+ < button
201+ type = "submit"
202+ disabled = { formState . isSubmitting }
183203 className = { clsx (
184- 'flex-1' ,
185- 'flex flex-row items-center overflow-x-clip' ,
204+ 'p-2 flex-shrink-0 cursor-pointer' ,
205+ 'bg-transparent border-none outline-none' ,
206+ formState . isSubmitting && 'opacity-50' ,
186207 ) }
187208 >
188- < Dropdown
189- data = { statTypes }
190- selected = { selectedPluginType }
191- setSelected = { ( el ) => {
192- setSelectedPluginType ( el ) ;
193- } }
194- />
195- < span
196- className = { clsx (
197- 'text-gray5 dark:text-gray3' ,
198- 'mx-3 body3 text-[22px]' ,
199- 'max-[425px]:invisible max-[425px]:hidden' ,
200- ) }
201- >
202- /
203- </ span >
204- < TextInput
205- className = "text-gray7 dark:text-white placeholder:text-gray5 dark:placeholder:text-gray4"
206- placeholder = { t . githubUsername }
207- value = { login }
208- onChange = { ( e ) => {
209- setLogin ( e . target . value . trim ( ) ) ;
210- } }
211- onFocus = { ( ) => setShowHistory ( true ) }
212- onBlur = { ( ) => {
213- // Delay to allow click on history items
214- setTimeout ( ( ) => setShowHistory ( false ) , 200 ) ;
215- } }
216- />
217- </ div >
209+ { formState . isSubmitting ? (
210+ < div className = "border-2 border-gray8 dark:border-gray3 border-t-transparent rounded-full w-5 h-5 animate-spin" />
211+ ) : (
212+ < SearchIcon size = { 22 } className = "text-gray8 dark:text-white" />
213+ ) }
214+ </ button >
218215 </ div >
219216 </ form >
220217 < SearchHistoryDropdown
0 commit comments