refactor: add icons and text to the drawer

main
Josue 4 years ago committed by Tsu-ba-me
parent acd6052b71
commit 45d0368d6f
  1. 23
      striker-ui/components/AnvilDrawer.tsx
  2. 2
      striker-ui/components/Header.tsx
  3. 40
      striker-ui/lib/consts/ICONS.ts

@ -2,6 +2,7 @@ import { Drawer, List, ListItem } from '@material-ui/core';
import { makeStyles, createStyles } from '@material-ui/core/styles'; import { makeStyles, createStyles } from '@material-ui/core/styles';
import { Dispatch, SetStateAction } from 'react'; import { Dispatch, SetStateAction } from 'react';
import { BodyText } from './Text'; import { BodyText } from './Text';
import { ICONS, ICON_SIZE } from '../lib/consts/ICONS';
interface DrawerProps { interface DrawerProps {
open: boolean; open: boolean;
@ -11,7 +12,9 @@ interface DrawerProps {
const useStyles = makeStyles(() => const useStyles = makeStyles(() =>
createStyles({ createStyles({
list: { list: {
width: 'auto', width: '15vw',
backdropFilter: 'blur(10px)',
opacity: 0.7,
}, },
}), }),
); );
@ -21,11 +24,21 @@ const AnvilDrawer = ({ open, setOpen }: DrawerProps): JSX.Element => {
return ( return (
<Drawer anchor="left" open={open} onClose={() => setOpen(!open)}> <Drawer anchor="left" open={open} onClose={() => setOpen(!open)}>
<div role="presentation" className={classes.list}> <div role="presentation">
<List> <List className={classes.list}>
<ListItem button> {ICONS.map(
<BodyText text="Button" /> (icon): JSX.Element => (
<ListItem button key={icon.image}>
<img
alt=""
key="icon"
src={icon.image} // eslint-disable-next-line react/jsx-props-no-spreading
{...ICON_SIZE}
/>
<BodyText text={icon.text} />
</ListItem> </ListItem>
),
)}
</List> </List>
</div> </div>
</Drawer> </Drawer>

@ -49,7 +49,7 @@ const Header = (): JSX.Element => {
<img <img
alt="" alt=""
key="icon" key="icon"
src={icon} // eslint-disable-next-line react/jsx-props-no-spreading src={icon.image} // eslint-disable-next-line react/jsx-props-no-spreading
{...ICON_SIZE} {...ICON_SIZE}
/> />
), ),

@ -1,12 +1,36 @@
export const ICONS = [ export const ICONS = [
'/pngs/files_on.png', {
'/pngs/tasks_no-jobs_icon.png', text: 'Files',
'/pngs/configure_icon_on.png', image: '/pngs/files_on.png',
'/pngs/striker_icon_on.png', },
'/pngs/anvil_icon_on.png', {
'/pngs/email_on.png', text: 'Tasks',
'/pngs/users_icon_on.png', image: '/pngs/tasks_no-jobs_icon.png',
'/pngs/help_icon_on.png', },
{
text: 'Configure',
image: '/pngs/configure_icon_on.png',
},
{
text: 'Striker',
image: '/pngs/striker_icon_on.png',
},
{
text: 'Anvil',
image: '/pngs/anvil_icon_on.png',
},
{
text: 'Email',
image: '/pngs/email_on.png',
},
{
text: 'Users',
image: '/pngs/users_icon_on.png',
},
{
text: 'Help',
image: '/pngs/help_icon_on.png',
},
]; ];
export const ICON_SIZE = { export const ICON_SIZE = {

Loading…
Cancel
Save