@material-ui/core#PopoverProps TypeScript Examples

The following examples show how to use @material-ui/core#PopoverProps. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx    From frontegg-react with MIT License 6 votes vote down vote up
mapper = (props: PopupProps): Omit<PopoverProps, 'open'> => {
  const { position: { vertical, horizontal } = { vertical: 'bottom', horizontal: 'center' } } = props;
  return {
    anchorOrigin: {
      vertical,
      horizontal,
    },

    transformOrigin: {
      vertical: invertedVerticalPositions[vertical],
      horizontal: invertedHorizontalPositions[horizontal],
    },
  };
}
Example #2
Source File: ChangeNetworkButton.tsx    From homebase-app with MIT License 5 votes vote down vote up
NetworkMenu: React.FC<
  PopoverProps & { handleNetworkChange: (network: Network) => void }
> = ({ handleNetworkChange, ...props }) => {
  return (
    <StyledPopover
      id={"wallet-Popper"}
      style={{ zIndex: 1500, borderRadius: 4 }}
      PaperProps={{
        style: { borderRadius: 4, backgroundColor: "transparent" },
      }}
      {...props}
    >
      <AddressMenu>
        <AddressMenuItem
          container
          alignItems="center"
          onClick={() => handleNetworkChange("mainnet")}
        >
          <Grid item>
            <Typography variant="subtitle2" color="textSecondary">
              MAINNET
            </Typography>
          </Grid>
        </AddressMenuItem>
        <AddressMenuItem
          container
          alignItems="center"
          onClick={() => handleNetworkChange("hangzhounet")}
        >
          <Grid item>
            <Typography variant="subtitle2" color="textSecondary">
              HANGZHOUNET
            </Typography>
          </Grid>
        </AddressMenuItem>
        <AddressMenuItem
          container
          alignItems="center"
          onClick={() => handleNetworkChange("ithacanet")}
        >
          <Grid item>
            <Typography variant="subtitle2" color="textSecondary">
              ITHACANET
            </Typography>
          </Grid>
        </AddressMenuItem>
      </AddressMenu>
    </StyledPopover>
  );
}