diff --git a/frontend/packages/core/src/components/DefaultEntityPageNavbar/DefaultEntityPageNavbar.tsx b/frontend/packages/core/src/components/DefaultEntityPageNavbar/DefaultEntityPageNavbar.tsx index 3b827cf838..69aed8bd9f 100644 --- a/frontend/packages/core/src/components/DefaultEntityPageNavbar/DefaultEntityPageNavbar.tsx +++ b/frontend/packages/core/src/components/DefaultEntityPageNavbar/DefaultEntityPageNavbar.tsx @@ -1,21 +1,35 @@ import React, { FC } from 'react'; import { EntityPageNavbarProps } from '../../api/entityView/types'; -import { useEntityUri, EntityLink } from '../..'; -import { List, ListItem } from '@material-ui/core'; +import { useEntityUri } from '../..'; +import { List, makeStyles, Theme } from '@material-ui/core'; +import NavbarItem from './NavbarItem'; + +const useStyles = makeStyles({ + nav: { + gridArea: 'pageNav', + width: 220, + transition: 'width 0.07s, height 0s', + transitionTimingFunction: 'ease-in', + backgroundColor: '#eeeeee', + boxShadow: '0px 0 4px 0px rgba(0,0,0,0.35)', + }, + list: { + padding: 0, + }, +}); const DefaultEntityPageNavbar: FC = ({ navItems }) => { + const classes = useStyles(); const entityUri = useEntityUri(); return ( - - {navItems.map(({ title, target }) => ( - - - {title} - - - ))} - + ); }; diff --git a/frontend/packages/core/src/components/DefaultEntityPageNavbar/NavbarItem.tsx b/frontend/packages/core/src/components/DefaultEntityPageNavbar/NavbarItem.tsx new file mode 100644 index 0000000000..d75ee16f4c --- /dev/null +++ b/frontend/packages/core/src/components/DefaultEntityPageNavbar/NavbarItem.tsx @@ -0,0 +1,72 @@ +import React, { FC } from 'react'; +import { EntityLink } from '../..'; +import { + ListItem, + makeStyles, + Theme, + ListItemIcon, + ListItemText, + Typography, +} from '@material-ui/core'; +import { EntityPageNavItem } from '../../api/entityView/types'; + +const useStyles = makeStyles(theme => ({ + root: { + display: 'block', + overflow: 'hidden', + borderBottom: `1px solid #d9d9d9`, + paddingLeft: theme.spacing(1), + }, + label: { + color: '#333', + fontWeight: 'bolder', + whiteSpace: 'nowrap', + lineHeight: 1.0, + }, + iconImg: { + width: 24, + height: 24, + }, + icon: { + margin: theme.spacing(0.5, 2, 0.5, 0), + minWidth: 0, + fontSize: 24, + }, + expand: { + color: 'white', + }, +})); + +type Props = { + navItem: EntityPageNavItem; + entityUri: string; +}; + +const NavbarItem: FC = ({ navItem, entityUri }) => { + const classes = useStyles(); + const IconComponent = navItem.icon; + + return ( + + + + + + + {navItem.title} + + } + disableTypography + /> + + + ); +}; + +export default NavbarItem;