@@ -21,7 +21,7 @@ import Button from '@leafygreen-ui/button';
21
21
import IconButton from '@leafygreen-ui/icon-button' ;
22
22
import { useDarkMode } from '@leafygreen-ui/leafygreen-provider' ;
23
23
import TextInput from '@leafygreen-ui/text-input' ;
24
- import { Body } from '@leafygreen-ui/typography' ;
24
+ import { Body , useUpdatedBaseFontSize } from '@leafygreen-ui/typography' ;
25
25
26
26
import { Icon } from '../../../icon/src/Icon' ;
27
27
@@ -42,7 +42,11 @@ import {
42
42
} from './SearchPanel.styles' ;
43
43
import { SearchPanelProps } from './SearchPanel.types' ;
44
44
45
- export function SearchPanel ( { view } : SearchPanelProps ) {
45
+ export function SearchPanel ( {
46
+ view,
47
+ darkMode,
48
+ baseFontSize : baseFontSizeProp ,
49
+ } : SearchPanelProps ) {
46
50
const [ isOpen , setIsOpen ] = useState ( false ) ;
47
51
const [ searchString , setSearchString ] = useState ( '' ) ;
48
52
const [ replaceString , setReplaceString ] = useState ( '' ) ;
@@ -59,7 +63,8 @@ export function SearchPanel({ view }: SearchPanelProps) {
59
63
} ) ,
60
64
) ;
61
65
const [ findCount , setFindCount ] = useState ( 0 ) ;
62
- const { theme } = useDarkMode ( ) ;
66
+ const { theme } = useDarkMode ( darkMode ) ;
67
+ const baseFontSize = useUpdatedBaseFontSize ( ) ;
63
68
const [ selectedIndex , setSelectedIndex ] = useState < number | null > ( null ) ;
64
69
65
70
const updateSelectedIndex = useCallback ( ( ) => {
@@ -204,7 +209,11 @@ export function SearchPanel({ view }: SearchPanelProps) {
204
209
205
210
return (
206
211
< div
207
- className = { getContainerStyles ( { theme, isOpen } ) }
212
+ className = { getContainerStyles ( {
213
+ theme,
214
+ isOpen,
215
+ baseFontSize : baseFontSizeProp || baseFontSize ,
216
+ } ) }
208
217
data-no-context-menu = "true"
209
218
>
210
219
< div className = { findSectionStyles } >
@@ -226,6 +235,8 @@ export function SearchPanel({ view }: SearchPanelProps) {
226
235
// eslint-disable-next-line jsx-a11y/no-autofocus
227
236
autoFocus
228
237
value = { searchString }
238
+ baseFontSize = { baseFontSizeProp || baseFontSize }
239
+ darkMode = { darkMode }
229
240
/>
230
241
< div className = { findOptionsContainerStyles } >
231
242
{ searchString && (
@@ -259,6 +270,8 @@ export function SearchPanel({ view }: SearchPanelProps) {
259
270
selectMatches ( view ) ;
260
271
setSelectedIndex ( null ) ;
261
272
} }
273
+ baseFontSize = { baseFontSizeProp || baseFontSize }
274
+ darkMode = { darkMode }
262
275
>
263
276
All
264
277
</ Button >
@@ -284,18 +297,24 @@ export function SearchPanel({ view }: SearchPanelProps) {
284
297
value = { replaceString }
285
298
onChange = { handleReplaceQueryChange }
286
299
onKeyDown = { handleReplaceInputKeyDown }
300
+ baseFontSize = { baseFontSizeProp || baseFontSize }
301
+ darkMode = { darkMode }
287
302
/>
288
303
< Button
289
304
aria-label = "replace button"
290
305
className = { replaceButtonStyles }
291
306
onClick = { handleReplace }
307
+ baseFontSize = { baseFontSizeProp || baseFontSize }
308
+ darkMode = { darkMode }
292
309
>
293
310
Replace
294
311
</ Button >
295
312
< Button
296
313
aria-label = "replace all button"
297
314
className = { replaceButtonStyles }
298
315
onClick = { handleReplaceAll }
316
+ baseFontSize = { baseFontSizeProp || baseFontSize }
317
+ darkMode = { darkMode }
299
318
>
300
319
Replace All
301
320
</ Button >
0 commit comments