@@ -36,9 +33,9 @@ export default function PortalClickAway() {
{open ? (
-
+
Click me, I will stay visible until you click outside.
-
+
) : null}
diff --git a/docs/src/pages/components/click-away-listener/PortalClickAway.tsx b/docs/src/pages/components/click-away-listener/PortalClickAway.tsx
index 35d4eddb44ef0a..cda151c25961e5 100644
--- a/docs/src/pages/components/click-away-listener/PortalClickAway.tsx
+++ b/docs/src/pages/components/click-away-listener/PortalClickAway.tsx
@@ -1,25 +1,10 @@
import * as React from 'react';
-import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
+import Box from '@material-ui/core/Box';
import ClickAwayListener from '@material-ui/core/ClickAwayListener';
import Portal from '@material-ui/core/Portal';
-
-const useStyles = makeStyles((theme: Theme) =>
- createStyles({
- dropdown: {
- position: 'fixed',
- width: 200,
- top: '50%',
- left: '50%',
- transform: 'translate(-50%, -50%)',
- border: '1px solid',
- padding: theme.spacing(1),
- backgroundColor: theme.palette.background.paper,
- },
- }),
-);
+import { SxProps } from '@material-ui/system';
export default function PortalClickAway() {
- const classes = useStyles();
const [open, setOpen] = React.useState(false);
const handleClick = () => {
@@ -30,6 +15,17 @@ export default function PortalClickAway() {
setOpen(false);
};
+ const styles: SxProps = {
+ position: 'fixed',
+ width: 200,
+ top: '50%',
+ left: '50%',
+ transform: 'translate(-50%, -50%)',
+ border: '1px solid',
+ p: 1,
+ bgcolor: 'background.paper',
+ };
+
return (