refactor: turn drawer icons and header icons into buttons and add URIs

main
Josue 4 years ago committed by Tsu-ba-me
parent 89313de042
commit 4f88f0113b
  1. 11
      striker-ui/components/AnvilDrawer.tsx
  2. 23
      striker-ui/components/Header.tsx
  3. 11
      striker-ui/lib/consts/ICONS.ts

@ -43,7 +43,16 @@ const AnvilDrawer = ({ open, setOpen }: DrawerProps): JSX.Element => {
<Divider className={classes.divider} />
{ICONS.map(
(icon): JSX.Element => (
<ListItem button key={icon.image}>
<ListItem
button
key={icon.image}
component="a"
href={
icon.uri.search(/^https?:/) !== -1
? icon.uri
: `${process.env.NEXT_PUBLIC_API_URL}${icon.uri}`
}
>
<Box display="flex" flexDirection="row" width="100%">
<Box>
<img

@ -58,13 +58,22 @@ const Header = (): JSX.Element => {
<Box className={`${classes.barElement} ${classes.icons}`}>
{ICONS.map(
(icon): JSX.Element => (
<img
alt=""
key="icon"
src={icon.image}
// eslint-disable-next-line react/jsx-props-no-spreading
{...ICON_SIZE}
/>
<a
key={icon.uri}
href={
icon.uri.search(/^https?:/) !== -1
? icon.uri
: `${process.env.NEXT_PUBLIC_API_URL}${icon.uri}`
}
>
<img
alt=""
key="icon"
src={icon.image}
// eslint-disable-next-line react/jsx-props-no-spreading
{...ICON_SIZE}
/>
</a>
),
)}
</Box>

@ -2,34 +2,37 @@ export const ICONS = [
{
text: 'Files',
image: '/pngs/files_on.png',
uri: '/striker?files=true',
},
{
text: 'Tasks',
image: '/pngs/tasks_no-jobs_icon.png',
uri: '/striker?jobs=true',
},
{
text: 'Configure',
image: '/pngs/configure_icon_on.png',
uri: '/striker?configure=true',
},
{
text: 'Striker',
image: '/pngs/striker_icon_on.png',
uri: '/striker?striker=true',
},
{
text: 'Anvil',
image: '/pngs/anvil_icon_on.png',
uri: '/striker?anvil=true',
},
{
text: 'Email',
image: '/pngs/email_on.png',
},
{
text: 'Users',
image: '/pngs/users_icon_on.png',
uri: '/striker?email=true',
},
{
text: 'Help',
image: '/pngs/help_icon_on.png',
uri: 'https://alteeve.com/w/Support',
},
];

Loading…
Cancel
Save