From 8779c4f31c412ab13b0e82dd0a7f29d89bc2e23e Mon Sep 17 00:00:00 2001 From: Artur Santiago Date: Wed, 13 Oct 2021 22:14:44 -0300 Subject: [PATCH] feat: create menu item component --- src/components/MenuItem/MenuItem.tsx | 74 +++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 6 deletions(-) diff --git a/src/components/MenuItem/MenuItem.tsx b/src/components/MenuItem/MenuItem.tsx index a3c01d7..15a4b6e 100644 --- a/src/components/MenuItem/MenuItem.tsx +++ b/src/components/MenuItem/MenuItem.tsx @@ -1,7 +1,69 @@ -import React from 'react'; +import { ListItem, ListItemIcon, ListItemText } from '@material-ui/core'; +import { SvgIconComponent } from '@material-ui/icons'; +import { makeStyles } from '@material-ui/styles'; +import clsx from 'clsx'; -export const MenuItem = (): JSX.Element => ( -
- MenuItem -
-); +const useStyles = makeStyles({ + menuItem: { + display: 'flex', + justifyContent: 'center', + minHeight: 44, + }, + menuItemActive: { + backgroundColor: '#EBEBEC', + }, + icon: { + justifyContent: 'center', + }, + iconActive: { + color: '#6EC177', + }, + primaryText: { + whiteSpace: 'nowrap', + }, + primaryTextActive: { + color: '#6EC177', + fontWeight: 500, + }, +}); + +type Props = { + icon: SvgIconComponent + small?: boolean + path: string + primaryText: string + onClick: () => void +} + +export const MenuItem = ({ + icon: Icon, + small, + path, + primaryText, + onClick, +}: Props): JSX.Element => { + const classes = useStyles(); + const isActive = path === '/dashboard'; + + function handleOnClick() { + onClick?.(); + } + + return ( + + + + + {/* {!small && ( */} + + {/* )} */} + + ); +};