FunctionProject/website/components/Header/NavigationLink.jsx

22 lines
456 B
React
Raw Normal View History

2020-08-03 12:04:07 +02:00
import Link from 'next/link'
import { useRouter } from 'next/router'
import './Header.css'
2020-03-18 16:26:18 +01:00
2020-08-03 12:04:07 +02:00
export default function NavigationLink (props) {
const { pathname } = useRouter()
2020-03-18 16:26:18 +01:00
2020-08-03 12:04:07 +02:00
return (
<li className='navbar-item'>
<Link href={props.path}>
2020-08-03 14:14:45 +02:00
<a
className={`navbar-link ${
pathname === props.path ? 'navbar-link-active' : null
}`}
>
2020-08-03 12:04:07 +02:00
{props.name}
</a>
</Link>
</li>
)
}