wiki/quartz/components/Header.tsx

21 lines
490 B
TypeScript
Raw Normal View History

2023-06-01 23:05:14 +00:00
import { resolveToRoot } from "../path"
2023-06-07 02:48:37 +00:00
import Darkmode from "./Darkmode"
2023-06-07 04:19:00 +00:00
import style from './styles/header.scss'
2023-06-01 23:05:14 +00:00
export interface HeaderProps {
title: string
slug: string
}
2023-06-07 02:48:37 +00:00
export default function Header({ title, slug }: HeaderProps) {
2023-06-01 23:05:14 +00:00
const baseDir = resolveToRoot(slug)
return <header>
<h1><a href={baseDir}>{title}</a></h1>
2023-06-07 02:48:37 +00:00
<div class="spacer"></div>
<Darkmode />
2023-06-01 23:05:14 +00:00
</header>
}
2023-06-03 19:07:19 +00:00
2023-06-07 02:48:37 +00:00
Header.beforeDOMLoaded = Darkmode.beforeDOMLoaded
Header.css = style + Darkmode.css