You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
1 year ago
|
'use client'
|
||
|
|
||
|
import React from 'react'
|
||
|
import Image from 'next/image'
|
||
|
|
||
|
import { usePathname } from 'next/navigation'
|
||
|
|
||
|
import header from '~/images/aurora-1197753.jpg'
|
||
|
|
||
|
export default function Title() {
|
||
|
const pathname = usePathname()
|
||
|
|
||
|
const isHomepage = pathname === '/'
|
||
|
|
||
|
return (
|
||
|
<header className={isHomepage ? 'homepage' : undefined}>
|
||
|
{isHomepage
|
||
|
? <h1 className="siteTitle">tempest.dev</h1>
|
||
|
: <a href="/" className="siteTitle">tempest.dev</a>
|
||
|
}
|
||
|
<nav>
|
||
1 year ago
|
<a href="/about">about</a>
|
||
1 year ago
|
<a href="/posts">posts</a>
|
||
|
<a href="/contact">contact</a>
|
||
|
</nav>
|
||
|
<div className="headerBackground">
|
||
|
<Image
|
||
|
src={header}
|
||
|
alt=""
|
||
|
role="presentation"
|
||
|
fill={true}
|
||
|
sizes={`
|
||
|
(max-width: 2560) 100vw,
|
||
|
(max-width: 1920) 100vw,
|
||
|
(max-width: 1280) 100vw,
|
||
|
(max-width: 800) 100vw,
|
||
|
(max-width: 600) 100vw,
|
||
|
`}
|
||
|
/>
|
||
|
</div>
|
||
|
</header>
|
||
|
)
|
||
|
}
|