1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 06:21:17 -04:00

stop being lazy with css selectors

This commit is contained in:
2022-01-30 11:38:37 -05:00
parent 9f34cec930
commit f0259dbab5
24 changed files with 498 additions and 471 deletions

View File

@@ -1,19 +1,20 @@
import Link from "next/link";
import classNames from "classnames";
import type { NoteMetaType } from "../../types";
import styles from "./NoteTitle.module.css";
type Props = Pick<NoteMetaType, "slug" | "htmlTitle">;
type Props = Pick<NoteMetaType, "slug" | "htmlTitle"> & { className?: string };
const NoteTitle = ({ slug, htmlTitle, ...rest }: Props) => (
<h1 className={styles.title}>
const NoteTitle = ({ slug, htmlTitle, className, ...rest }: Props) => (
<h1 className={classNames(styles.title, className)}>
<Link
href={{
pathname: "/notes/[slug]/",
query: { slug: slug },
}}
>
<a dangerouslySetInnerHTML={{ __html: htmlTitle }} {...rest} />
<a className={styles.link} dangerouslySetInnerHTML={{ __html: htmlTitle }} {...rest} />
</Link>
</h1>
);