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

organize types a bit more sanely & bump deps

This commit is contained in:
2022-02-24 07:06:34 -05:00
parent d24d29a04e
commit e6f1955efb
16 changed files with 267 additions and 645 deletions

View File

@@ -1,17 +1,17 @@
import { format } from "date-fns";
import Link from "../Link/Link";
import type { NoteMetaType } from "../../types";
import type { NoteType } from "../../types";
import styles from "./NotesList.module.css";
export type NotesListProps = {
notesByYear: Record<string, NoteMetaType[]>;
notesByYear: Record<string, NoteType["frontMatter"][]>;
};
const NotesList = ({ notesByYear }: NotesListProps) => {
const sections = [];
Object.entries(notesByYear).forEach(([year, notes]: [string, NoteMetaType[]]) => {
Object.entries(notesByYear).forEach(([year, notes]: [string, NoteType["frontMatter"][]]) => {
sections.push(
<section key={year} className={styles.section}>
<h2 className={styles.year}>{year}</h2>
@@ -23,7 +23,7 @@ const NotesList = ({ notesByYear }: NotesListProps) => {
<Link
href={{
pathname: "/notes/[slug]/",
query: { slug: slug },
query: { slug },
}}
dangerouslySetInnerHTML={{ __html: htmlTitle }}
/>