start extracting types to shared .d.ts file

This commit is contained in:
2022-01-10 14:18:33 -05:00
parent b552b6ae64
commit 0ef7ff5f92
12 changed files with 45 additions and 30 deletions
+2 -8
View File
@@ -1,19 +1,13 @@
import Link from "next/link";
import { format } from "date-fns";
import type { NoteMetaType } from "../../types";
import styles from "./List.module.css";
type NoteProps = {
title: string;
htmlTitle?: string;
date: string;
slug: string;
};
const List = ({ notesByYear }) => {
const sections = [];
Object.entries(notesByYear).forEach(([year, notes]: [string, NoteProps[]]) => {
Object.entries(notesByYear).forEach(([year, notes]: [string, NoteMetaType[]]) => {
sections.push(
<section key={year} className={styles.section}>
<h2 className={styles.year}>{year}</h2>
+2 -9
View File
@@ -3,18 +3,11 @@ import { format } from "date-fns";
import Hits from "../hits/Hits";
import { DateIcon, TagIcon, EditIcon, ViewsIcon } from "../icons";
import * as config from "../../lib/config";
import type { NoteMetaType } from "../../types";
import styles from "./Meta.module.css";
export type Props = {
title: string;
htmlTitle?: string;
date: string;
slug: string;
tags?: string[];
};
const Meta = ({ title, htmlTitle = "", date, slug, tags = [] }: Props) => (
const Meta = ({ title, htmlTitle, date, slug, tags = [] }: NoteMetaType) => (
<>
<div className={styles.meta}>
<div className={styles.date}>