|
|
|
@ -1,5 +1,4 @@ |
|
|
|
|
import React from 'react' |
|
|
|
|
|
|
|
|
|
import { NavLink } from 'react-router-dom' |
|
|
|
|
|
|
|
|
|
interface NavItemProps { |
|
|
|
@ -8,25 +7,25 @@ interface NavItemProps { |
|
|
|
|
title: string |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const NavItem = ({ to, icon, title }: NavItemProps) => { |
|
|
|
|
const NavItem: React.FC<NavItemProps> = ({ to, icon, title }) => { |
|
|
|
|
return ( |
|
|
|
|
<NavLink |
|
|
|
|
// data-id="home"
|
|
|
|
|
to={to} |
|
|
|
|
className={({ isActive }) => 'p-2 ' + (isActive ? 'bg-primary text-white' : 'bg-secondary')} |
|
|
|
|
className={({ isActive }) => 'p-2 text-decoration-none ' + (isActive ? 'bg-primary text-white' : 'bg-secondary')} |
|
|
|
|
// state={from}
|
|
|
|
|
> |
|
|
|
|
<div className="d-flex flex-column align-items-center justify-content-center"> |
|
|
|
|
<div>{icon}</div> |
|
|
|
|
<div>{title}</div> |
|
|
|
|
</div> |
|
|
|
|
<span className="d-flex flex-column align-items-center justify-content-center" style={{ width: '64px' }}> |
|
|
|
|
<span>{icon}</span> |
|
|
|
|
<span>{title}</span> |
|
|
|
|
</span> |
|
|
|
|
</NavLink> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const NavMenu = () => { |
|
|
|
|
return ( |
|
|
|
|
<nav className="d-flex flex-row justify-content-around"> |
|
|
|
|
<nav className="d-flex flex-row justify-content-around bg-secondary"> |
|
|
|
|
<NavItem to="/" icon={<i className="fas fa-home"></i>} title="Verify" /> |
|
|
|
|
<NavItem to="/receipts" icon={<i className="fas fa-receipt"></i>} title="Receipts" /> |
|
|
|
|
<NavItem to="/lookup" icon={<i className="fas fa-search"></i>} title="Lookup" /> |
|
|
|
|