Jacky Zhao
2023-06-12 352075ae81a3304a7bfa2512ef69b1cdacb26c12
quartz/components/Header.tsx
@@ -1,14 +1,23 @@
import { resolveToRoot } from "../path"
import { QuartzComponentProps } from "./types"
export interface HeaderProps {
  title: string
  slug: string
}
export default function({ title, slug }: HeaderProps) {
  const baseDir = resolveToRoot(slug)
export default function Header({ children }: QuartzComponentProps) {
  return <header>
    <h1><a href={baseDir}>{title}</a></h1>
    {children}
  </header>
}
Header.css = `
header {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 1em 0 2em 0;
  & > h1 {
  }
}
header > h1 {
  margin: 0;
  flex: auto;
}
`