Skip to content

Commit 4d68033

Browse files
committed
emotion: BorderedMenu
1 parent e3e626a commit 4d68033

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed
Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { css } from "@emotion/css";
2+
import { useTheme } from "@emotion/react";
13
import Popover, { PopoverProps } from "@mui/material/Popover";
2-
import { makeStyles } from "@mui/styles";
3-
import { FC, PropsWithChildren } from "react";
4+
import type { FC, PropsWithChildren } from "react";
45

56
type BorderedMenuVariant = "user-dropdown";
67

@@ -13,23 +14,17 @@ export const BorderedMenu: FC<PropsWithChildren<BorderedMenuProps>> = ({
1314
variant,
1415
...rest
1516
}) => {
16-
const styles = useStyles();
17+
const theme = useTheme();
18+
19+
const paper = css`
20+
width: 260px;
21+
border-radius: ${theme.shape.borderRadius};
22+
box-shadow: ${theme.shadows[6]};
23+
`;
1724

1825
return (
19-
<Popover
20-
classes={{ paper: styles.paperRoot }}
21-
data-variant={variant}
22-
{...rest}
23-
>
26+
<Popover classes={{ paper }} data-variant={variant} {...rest}>
2427
{children}
2528
</Popover>
2629
);
2730
};
28-
29-
const useStyles = makeStyles((theme) => ({
30-
paperRoot: {
31-
width: 260,
32-
borderRadius: theme.shape.borderRadius,
33-
boxShadow: theme.shadows[6],
34-
},
35-
}));

0 commit comments

Comments
 (0)