Skip to content

Commit a5e0707

Browse files
committed
refactor: convert SelectMenu
1 parent b8e7138 commit a5e0707

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed

site/src/components/SelectMenu/SelectMenu.tsx

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import {
2121
useMemo,
2222
} from "react";
2323

24-
const SIDE_PADDING = 16;
25-
2624
export const SelectMenu = Popover;
2725

2826
export const SelectMenuTrigger = PopoverTrigger;
@@ -54,22 +52,7 @@ export const SelectMenuSearch: FC<SearchFieldProps> = (props) => {
5452
<SearchField
5553
fullWidth
5654
size="medium"
57-
css={(theme) => ({
58-
borderBottom: `1px solid ${theme.palette.divider}`,
59-
"& input": {
60-
fontSize: 14,
61-
},
62-
"& fieldset": {
63-
border: 0,
64-
borderRadius: 0,
65-
},
66-
"& .MuiInputBase-root": {
67-
padding: `12px ${SIDE_PADDING}px`,
68-
},
69-
"& .MuiInputAdornment-positionStart": {
70-
marginRight: SIDE_PADDING,
71-
},
72-
})}
55+
className="border-solid border-b-px [&_input]:font-sm [&_fieldset]:border-none [&_fieldset]:rounded-none [&.MuiInputBase-root]:py-3 [&.MuiInputBase-root]:px-4 [&.MuiInputAdornment-positionStart]:mr-4"
7356
{...props}
7457
inputProps={{ autoFocus: true, ...props.inputProps }}
7558
/>
@@ -112,19 +95,9 @@ export const SelectMenuIcon: FC<HTMLProps<HTMLDivElement>> = (props) => {
11295

11396
export const SelectMenuItem: FC<MenuItemProps> = (props) => {
11497
return (
115-
<MenuItem
116-
css={{
117-
fontSize: 14,
118-
gap: 0,
119-
lineHeight: 1,
120-
padding: `12px ${SIDE_PADDING}px`,
121-
}}
122-
{...props}
123-
>
98+
<MenuItem className="text-sm gap-0 leading-none py-3 px-4" {...props}>
12499
{props.children}
125-
{props.selected && (
126-
<CheckIcon className="size-icon-xs" css={{ marginLeft: "auto" }} />
127-
)}
100+
{props.selected && <CheckIcon className="size-icon-xs ml-auto" />}
128101
</MenuItem>
129102
);
130103
};

0 commit comments

Comments
 (0)