@@ -68,16 +68,27 @@ const StyledContainer = styled('div', {
68
68
} ,
69
69
} ) ) ;
70
70
71
- const StyledSearch = styled ( 'div' ) ( ( { theme } ) => ( {
72
- display : 'flex' ,
73
- alignItems : 'center' ,
74
- backgroundColor : theme . palette . background . paper ,
75
- border : `1px solid ${ theme . palette . neutral . border } ` ,
76
- borderRadius : theme . shape . borderRadiusExtraLarge ,
77
- padding : '3px 5px 3px 12px' ,
78
- width : '100%' ,
79
- zIndex : 3 ,
80
- } ) ) ;
71
+ const StyledSearch = styled ( 'div' ) < { isOpen ?: boolean } > (
72
+ ( { theme, isOpen } ) => ( {
73
+ display : 'flex' ,
74
+ alignItems : 'center' ,
75
+ backgroundColor : theme . palette . background . paper ,
76
+ border : `1px solid ${ theme . palette . neutral . border } ` ,
77
+ borderRadius : theme . shape . borderRadiusExtraLarge ,
78
+ padding : '3px 5px 3px 12px' ,
79
+ width : '100%' ,
80
+ zIndex : 3 ,
81
+ ...( isOpen
82
+ ? {
83
+ borderBottomLeftRadius : 0 ,
84
+ borderBottomRightRadius : 0 ,
85
+ borderBottom : '0px' ,
86
+ paddingTop : theme . spacing ( 0.5 ) ,
87
+ paddingBottom : theme . spacing ( 0.5 ) ,
88
+ }
89
+ : { } ) ,
90
+ } ) ,
91
+ ) ;
81
92
82
93
const StyledInputBase = styled ( InputBase ) ( ( { theme } ) => ( {
83
94
width : '100%' ,
@@ -302,22 +313,7 @@ export const CommandBar = () => {
302
313
return (
303
314
< StyledContainer ref = { searchContainerRef } active = { showSuggestions } >
304
315
< RecentlyVisitedRecorder />
305
- < StyledSearch
306
- sx = { {
307
- borderBottomLeftRadius : ( theme ) =>
308
- showSuggestions
309
- ? 0
310
- : theme . shape . borderRadiusExtraLarge ,
311
- borderBottomRightRadius : ( theme ) =>
312
- showSuggestions
313
- ? 0
314
- : theme . shape . borderRadiusExtraLarge ,
315
- borderBottom : ( theme ) =>
316
- showSuggestions
317
- ? '0px'
318
- : `1px solid ${ theme . palette . neutral . border } ` ,
319
- } }
320
- >
316
+ < StyledSearch isOpen = { showSuggestions } >
321
317
< SearchIcon
322
318
sx = { {
323
319
mr : 1 ,
0 commit comments