all repos — caroster @ 9079b470260a87959da56f303e6682211cb847d1

[Octree] Group carpool to your event https://caroster.io

app/src/containers/EventMenu/index.js (view raw)

 1import React from "react";
 2import Menu from "@material-ui/core/Menu";
 3import MenuItem from "@material-ui/core/MenuItem";
 4
 5const EventMenu = ({ anchorEl, setAnchorEl, actions = [] }) => {
 6  return (
 7    <Menu
 8      anchorEl={anchorEl}
 9      anchorOrigin={{
10        vertical: "top",
11        horizontal: "right",
12      }}
13      keepMounted
14      transformOrigin={{
15        vertical: "top",
16        horizontal: "right",
17      }}
18      open={!!anchorEl}
19      onClose={() => setAnchorEl(null)}
20    >
21      {actions &&
22        actions.map((action, idx) => (
23          <MenuItem
24            onClick={() => {
25              action.onClick();
26              setAnchorEl(null);
27            }}
28            key={idx}
29            id={action.id || `MenuItem${idx}`}
30          >
31            {action.label}
32          </MenuItem>
33        ))}
34    </Menu>
35  );
36};
37
38export default EventMenu;