mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-07-30 12:55:21 -04:00
start extracting types to shared .d.ts file
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user