feat: updates main menu options

This commit is contained in:
Mark Mankarious
2023-08-28 19:45:07 +01:00
parent 109048c8d2
commit 031a90a78a
2 changed files with 31 additions and 4 deletions

View File

@@ -1,9 +1,14 @@
import React, { useState, useCallback } from 'react';
import { Menu, MenuItem, Typography } from '@mui/material';
import { Menu as MenuIcon } from '@mui/icons-material';
import { Menu, Typography, Divider } from '@mui/material';
import {
Menu as MenuIcon,
GitHub as GitHubIcon,
Download as DownloadIcon
} from '@mui/icons-material';
import { UiElement } from 'src/components/UiElement/UiElement';
import { IconButton } from 'src/components/IconButton/IconButton';
import { useUiStateStore } from 'src/stores/uiStateStore';
import { MenuItem } from './MenuItem';
export const MainMenu = () => {
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
@@ -46,8 +51,13 @@ export const MainMenu = () => {
}
}}
>
<MenuItem>Export</MenuItem>
<MenuItem onClick={gotoGithub}>
<MenuItem Icon={<DownloadIcon />}>Save to...</MenuItem>
<Divider />
<MenuItem onClick={gotoGithub} Icon={<GitHubIcon />}>
GitHub
</MenuItem>
<Divider />
<MenuItem>
<Typography variant="body2" color="text.secondary">
Isoflow v{PACKAGE_VERSION}
</Typography>

View File

@@ -0,0 +1,17 @@
import React from 'react';
import { MenuItem as MuiMenuItem, ListItemIcon } from '@mui/material';
export interface Props {
onClick?: () => void;
Icon?: React.ReactNode;
children: string | React.ReactNode;
}
export const MenuItem = ({ onClick, Icon, children }: Props) => {
return (
<MuiMenuItem onClick={onClick}>
<ListItemIcon>{Icon}</ListItemIcon>
{children}
</MuiMenuItem>
);
};