mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
working typescript version
This commit is contained in:
1 parent
581d6011e0
commit
cff746aa38
119 files changed
+247
-189
No files matched your search
@@ -0,0 +1,45 @@
|
||||
import React from "react";
|
||||
import {
|
||||
ListItemIcon,
|
||||
ListItemText,
|
||||
Slide,
|
||||
makeStyles,
|
||||
Paper,
|
||||
} from "@material-ui/core";
|
||||
import { List } from "./List";
|
||||
import { ListItem } from "./ListItem";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
width: "100%",
|
||||
position: "absolute",
|
||||
bottom: 0,
|
||||
zIndex: 2,
|
||||
},
|
||||
}));
|
||||
|
||||
export const ContextMenu = ({ open, onClose, options }) => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Slide direction="up" in={open} mountOnEnter unmountOnExit>
|
||||
<Paper square className={classes.root}>
|
||||
<List>
|
||||
{options.map((option) => (
|
||||
<ListItem
|
||||
selected={option.selected}
|
||||
key={option.key || option.label}
|
||||
button
|
||||
onClick={(e) => {
|
||||
option.onClick(e, option);
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
{option.icon && <ListItemIcon>{option.icon}</ListItemIcon>}
|
||||
<ListItemText primary={option.label} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</Paper>
|
||||
</Slide>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user