website/src/components/navbar.tsx

32 lines
592 B
TypeScript
Raw Normal View History

2020-11-27 16:08:32 +00:00
import React from 'react';
2020-11-28 00:39:21 +00:00
import { Link } from 'gatsby';
2020-11-27 16:08:32 +00:00
2020-11-28 00:39:21 +00:00
const ExactLink = (props) => (
<Link
to={props.to}
style={{ textDecoration: 'none' }}
activeStyle={{ color: 'red' }}
partiallyActive={!props.home}
>
{props.children}
</Link>
);
2020-11-27 16:08:32 +00:00
export default function Navbar() {
return (
<nav>
2020-11-28 00:39:21 +00:00
<h1>
<ExactLink to='/' home={true}>
Edward Shen
</ExactLink>
</h1>
<h3>
<ExactLink to='/projects'>Projects</ExactLink>
</h3>
<h3>
<ExactLink to='/notes'>Notes</ExactLink>
</h3>
</nav>
2020-11-27 16:08:32 +00:00
);
2020-11-28 00:39:21 +00:00
}