@@ -12,13 +12,13 @@ import {
12
12
baseSelectedSlotAtom ,
13
13
SelectedSlotValidityState ,
14
14
} from "../Overview/SlotPerformance/atoms" ;
15
- import { useQuickSearchWidth } from "../../hooks/useQuickSearchWidth" ;
16
15
import { 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" ;
18
17
import {
19
18
numQuickSearchSlots ,
20
19
quickSearchCardWidth ,
21
- quickSearchSpacing ,
20
+ slotSearchGap ,
21
+ slotSearchMaxWidth ,
22
22
slotSearchPadding ,
23
23
} from "../../consts" ;
24
24
import styles from "./slotSearch.module.css" ;
@@ -50,7 +50,6 @@ export function SlotSearch() {
50
50
const [ searchSlot , setSearchSlot ] = useState < string > ( "" ) ;
51
51
const epoch = useAtomValue ( epochAtom ) ;
52
52
const { isValid } = useAtomValue ( baseSelectedSlotAtom ) ;
53
- const quickSearchWidth = useQuickSearchWidth ( ) ;
54
53
55
54
const submitSearch = useCallback ( ( ) => {
56
55
if ( searchSlot === "" ) setSelectedSlot ( undefined ) ;
@@ -63,14 +62,14 @@ export function SlotSearch() {
63
62
} , [ selectedSlot ] ) ;
64
63
65
64
return (
66
- < Flex
67
- direction = "column"
68
- width = { `${ quickSearchWidth } px` }
69
- height = "100%"
65
+ < Grid
66
+ width = "100%"
67
+ maxWidth = { `${ slotSearchMaxWidth } px` }
70
68
justify = "center"
71
- align = "center "
72
- gap = "40px"
69
+ m = "auto "
70
+ gap = { ` ${ slotSearchGap } px` }
73
71
p = { `${ slotSearchPadding } px` }
72
+ columns = { `repeat(auto-fit, ${ quickSearchCardWidth } px)` }
74
73
>
75
74
< form
76
75
onSubmit = { ( e ) => {
@@ -92,6 +91,7 @@ export function SlotSearch() {
92
91
onChange = { ( e ) => setSearchSlot ( e . target . value ) }
93
92
size = "3"
94
93
color = { isValid ? "teal" : "red" }
94
+ autoFocus
95
95
>
96
96
< TextField . Slot side = "right" >
97
97
< IconButton variant = "ghost" color = "gray" onClick = { submitSearch } >
@@ -102,7 +102,7 @@ export function SlotSearch() {
102
102
{ ! isValid && < Errors /> }
103
103
</ form >
104
104
< QuickSearch />
105
- </ Flex >
105
+ </ Grid >
106
106
) ;
107
107
}
108
108
@@ -121,12 +121,7 @@ function QuickSearch() {
121
121
} , [ processedLeaderSlots ] ) ;
122
122
123
123
return (
124
- < Flex
125
- gap = { `${ quickSearchSpacing } px` }
126
- justify = "center"
127
- align = "center"
128
- wrap = "wrap"
129
- >
124
+ < >
130
125
< QuickSearchCard
131
126
icon = { < CounterClockwiseClockIcon /> }
132
127
label = "Earliest Slots"
@@ -172,7 +167,7 @@ function QuickSearch() {
172
167
metricsFmt = { getSolStringWithFourDecimals }
173
168
unit = "SOL"
174
169
/>
175
- </ Flex >
170
+ </ >
176
171
) ;
177
172
}
178
173
0 commit comments