mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Use recoil for state management
This commit is contained in:
1 parent
7a46eaf2be
commit
d8f756b309
10 files changed
+63
-49
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import React from "react";
|
||||
import { ClickAwayListener } from "@material-ui/core";
|
||||
|
||||
export const AppWrapper = ({ children, style, handleClickAway, ...props }) => {
|
||||
return (
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import React from "react";
|
||||
import {
|
||||
Drawer,
|
||||
ListItem,
|
||||
List,
|
||||
ListItemIcon,
|
||||
ListItemText,
|
||||
Slide,
|
||||
makeStyles,
|
||||
ClickAwayListener,
|
||||
} from "@material-ui/core";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
@@ -15,33 +13,31 @@ const useStyles = makeStyles((theme) => ({
|
||||
width: "100%",
|
||||
backgroundColor: theme.palette.background.default,
|
||||
color: "black",
|
||||
zIndex: 2
|
||||
zIndex: 2,
|
||||
},
|
||||
}));
|
||||
|
||||
export const ContextMenu = ({ open, onClose, handleClickAway, options }) => {
|
||||
export const ContextMenu = ({ open, onClose, options }) => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<ClickAwayListener onClickAway={handleClickAway}>
|
||||
<Slide direction="up" in={open} mountOnEnter unmountOnExit>
|
||||
<div className={classes.root}>
|
||||
<List component="nav" aria-label="context menu">
|
||||
{options.map((option) => (
|
||||
<ListItem
|
||||
button
|
||||
key={option.key}
|
||||
onClick={(e) => {
|
||||
option.onClick(e, option);
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
<ListItemIcon>{option.icon}</ListItemIcon>
|
||||
<ListItemText primary={option.label} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</div>
|
||||
</Slide>
|
||||
</ClickAwayListener>
|
||||
<Slide direction="up" in={open} mountOnEnter unmountOnExit>
|
||||
<div className={classes.root}>
|
||||
<List component="nav" aria-label="context menu">
|
||||
{options.map((option) => (
|
||||
<ListItem
|
||||
button
|
||||
key={option.key}
|
||||
onClick={(e) => {
|
||||
option.onClick(e, option);
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
<ListItemIcon>{option.icon}</ListItemIcon>
|
||||
<ListItemText primary={option.label} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</div>
|
||||
</Slide>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user