@@ -12,13 +12,13 @@ import {
1212 baseSelectedSlotAtom ,
1313 SelectedSlotValidityState ,
1414} from "../Overview/SlotPerformance/atoms" ;
15- import { useQuickSearchWidth } from "../../hooks/useQuickSearchWidth" ;
1615import { Label } from "radix-ui" ;
17- import { Flex , IconButton , TextField , Text } from "@radix-ui/themes" ;
16+ import { Flex , IconButton , TextField , Text , Grid } from "@radix-ui/themes" ;
1817import {
1918 numQuickSearchSlots ,
2019 quickSearchCardWidth ,
21- quickSearchSpacing ,
20+ slotSearchGap ,
21+ slotSearchMaxWidth ,
2222 slotSearchPadding ,
2323} from "../../consts" ;
2424import styles from "./slotSearch.module.css" ;
@@ -50,7 +50,6 @@ export function SlotSearch() {
5050 const [ searchSlot , setSearchSlot ] = useState < string > ( "" ) ;
5151 const epoch = useAtomValue ( epochAtom ) ;
5252 const { isValid } = useAtomValue ( baseSelectedSlotAtom ) ;
53- const quickSearchWidth = useQuickSearchWidth ( ) ;
5453
5554 const submitSearch = useCallback ( ( ) => {
5655 if ( searchSlot === "" ) setSelectedSlot ( undefined ) ;
@@ -63,14 +62,14 @@ export function SlotSearch() {
6362 } , [ selectedSlot ] ) ;
6463
6564 return (
66- < Flex
67- direction = "column"
68- width = { `${ quickSearchWidth } px` }
69- height = "100%"
65+ < Grid
66+ width = "100%"
67+ maxWidth = { `${ slotSearchMaxWidth } px` }
7068 justify = "center"
71- align = "center "
72- gap = "40px"
69+ m = "auto "
70+ gap = { ` ${ slotSearchGap } px` }
7371 p = { `${ slotSearchPadding } px` }
72+ columns = { `repeat(auto-fit, ${ quickSearchCardWidth } px)` }
7473 >
7574 < form
7675 onSubmit = { ( e ) => {
@@ -92,6 +91,7 @@ export function SlotSearch() {
9291 onChange = { ( e ) => setSearchSlot ( e . target . value ) }
9392 size = "3"
9493 color = { isValid ? "teal" : "red" }
94+ autoFocus
9595 >
9696 < TextField . Slot side = "right" >
9797 < IconButton variant = "ghost" color = "gray" onClick = { submitSearch } >
@@ -102,7 +102,7 @@ export function SlotSearch() {
102102 { ! isValid && < Errors /> }
103103 </ form >
104104 < QuickSearch />
105- </ Flex >
105+ </ Grid >
106106 ) ;
107107}
108108
@@ -121,12 +121,7 @@ function QuickSearch() {
121121 } , [ processedLeaderSlots ] ) ;
122122
123123 return (
124- < Flex
125- gap = { `${ quickSearchSpacing } px` }
126- justify = "center"
127- align = "center"
128- wrap = "wrap"
129- >
124+ < >
130125 < QuickSearchCard
131126 icon = { < CounterClockwiseClockIcon /> }
132127 label = "Earliest Slots"
@@ -172,7 +167,7 @@ function QuickSearch() {
172167 metricsFmt = { getSolStringWithFourDecimals }
173168 unit = "SOL"
174169 />
175- </ Flex >
170+ </ >
176171 ) ;
177172}
178173
0 commit comments