import { Typography } from '@material-ui/core'; import Drawer from '@material-ui/core/Drawer'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import { Link } from 'react-router-dom'; import { history } from '../../redux/configureStore'; import { RootState } from '../../redux/reducers'; import { ReactComponent as CommunityIcon } from '../../svg/community.svg'; import { ReactComponent as HomeIcon } from '../../svg/home.svg'; import { ReactComponent as SettingsIcon } from '../../svg/settings.svg'; import { ReactComponent as WorkflowsIcon } from '../../svg/workflows.svg'; import useStyles from './styles'; interface CustomisedListItemProps { handleClick: (event: React.MouseEvent) => void; label: string; } const CustomisedListItem: React.FC = ({ children, handleClick, label, }) => { const classes = useStyles(); return ( {children} ); }; const SideBar: React.FC = () => { const classes = useStyles(); const userRole = useSelector((state: RootState) => state.userData.userRole); const { t } = useTranslation(); return (
litmus logo {t('sidebar.title')}
{ history.push('/'); }} label="Home" > { history.push('/workflows'); }} label="Workflows" > { history.push('/community'); }} label="Community" > {userRole === 'Owner' && ( { history.push('/settings'); }} label="Settings" > )}
); }; export default SideBar;