mirror of
https://github.com/stan-smith/FossFLOW.git
synced 2025-12-25 23:49:10 -05:00
feat: updates main menu options
This commit is contained in:
@@ -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>
|
||||
|
||||
17
src/components/MainMenu/MenuItem.tsx
Normal file
17
src/components/MainMenu/MenuItem.tsx
Normal 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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user