Make navigation menu prettier

pull/5285/head
Manuel Wedler 5 months ago committed by Aniket
parent 8147e61169
commit 1f0a5c46d0
  1. 4
      apps/contract-verification/src/app/App.css
  2. 15
      apps/contract-verification/src/app/components/NavMenu.tsx
  3. 2
      apps/contract-verification/src/app/layouts/Default.tsx

@ -1,7 +1,3 @@
body {
margin: 0;
}
#root {
padding: 8px 14px;
}

@ -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" />

@ -12,7 +12,7 @@ export const DefaultLayout = ({ children, title, description }: PropsWithChildre
return (
<div>
<NavMenu />
<div className="my-4">
<div className="my-4 px-3">
<div>
<h2 className="text-center text-uppercase font-weight-bold">{title}</h2>
<p className="text-center" style={{ fontSize: '0.8rem' }}>

Loading…
Cancel
Save