Skip to content

Commit 3912b44

Browse files
committed
fix: command bar search padding
1 parent bdc21cc commit 3912b44

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

frontend/src/component/commandBar/CommandBar.tsx

+22-26
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,27 @@ const StyledContainer = styled('div', {
6868
},
6969
}));
7070

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+
);
8192

8293
const StyledInputBase = styled(InputBase)(({ theme }) => ({
8394
width: '100%',
@@ -302,22 +313,7 @@ export const CommandBar = () => {
302313
return (
303314
<StyledContainer ref={searchContainerRef} active={showSuggestions}>
304315
<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}>
321317
<SearchIcon
322318
sx={{
323319
mr: 1,

0 commit comments

Comments
 (0)