personal-site/layouts/general_layout/GeneralHeader.jsx

46 lines
1.3 KiB
React
Raw Normal View History

2022-01-06 05:27:13 +00:00
import React from 'react'
2022-06-04 07:26:53 +00:00
import { useRouter } from 'next/router';
2022-01-06 05:27:13 +00:00
const GeneralHeader = () => {
2022-06-04 07:26:53 +00:00
const router = useRouter();
function pushRouter(e) {
2022-06-10 07:49:12 +00:00
e.preventDefault();
2022-06-04 07:26:53 +00:00
let url = e.target.dataset.href;
router.push(url);
}
2022-01-06 05:27:13 +00:00
return (
<header>
2022-06-10 07:49:12 +00:00
<a className="logo-link-block" onClick={ () => {
pushRouter("/")
} }><h1>Tben.me</h1></a>
2022-01-06 05:27:13 +00:00
<nav>
2022-06-10 07:49:12 +00:00
<a href='/' data-href="/" onClick={ (e) => {
pushRouter(e)
} }>Home</a>
<a href='/about' data-href="/about" onClick={ (e) => {
pushRouter(e)
} }>About Me</a>
<a href='/work' data-href="/work" onClick={ (e) => {
pushRouter(e)
} }>My Work</a>
<a href='/blog' data-href="/blog" onClick={ (e) => {
pushRouter(e)
} }>Blog</a>
2022-06-04 07:26:53 +00:00
<a data-href="#" href='/documents/Benjamin_Toby_CV-updated.pdf' target="_blank">My Resume</a>
2022-06-10 07:49:12 +00:00
<a href='/contact' data-href="/contact" onClick={ (e) => {
pushRouter(e)
} }>Contact Me</a>
2022-01-06 05:27:13 +00:00
</nav>
</header>
)
}
export default GeneralHeader