mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-09-06 02:55:38 -04:00
clean up note types
This commit is contained in:
@@ -6,7 +6,7 @@ import NoteTitle from "../NoteTitle";
|
||||
import { DateIcon, TagIcon, EditIcon, ViewsIcon } from "../Icons";
|
||||
import { styled } from "../../lib/styles/stitches.config";
|
||||
import * as config from "../../lib/config";
|
||||
import type { NoteType } from "../../types";
|
||||
import type { NoteFrontMatter } from "../../types";
|
||||
|
||||
const Wrapper = styled("div", {
|
||||
display: "inline-flex",
|
||||
@@ -56,7 +56,7 @@ const Tag = styled("span", {
|
||||
},
|
||||
});
|
||||
|
||||
export type NoteMetaProps = Pick<NoteType["frontMatter"], "slug" | "date" | "title" | "htmlTitle" | "tags">;
|
||||
export type NoteMetaProps = Pick<NoteFrontMatter, "slug" | "date" | "title" | "htmlTitle" | "tags">;
|
||||
|
||||
const NoteMeta = ({ slug, date, title, htmlTitle, tags = [] }: NoteMetaProps) => (
|
||||
<>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import NextLink from "next/link";
|
||||
import { styled } from "../../lib/styles/stitches.config";
|
||||
import type { ComponentProps } from "react";
|
||||
import type { NoteType } from "../../types";
|
||||
import type { NoteFrontMatter } from "../../types";
|
||||
|
||||
const Title = styled("h1", {
|
||||
margin: "0.3em 0 0.5em -1px", // misaligned left margin, super nitpicky
|
||||
@@ -23,7 +23,7 @@ const Link = styled("a", {
|
||||
textDecoration: "none",
|
||||
});
|
||||
|
||||
export type NoteTitleProps = Pick<NoteType["frontMatter"], "slug" | "htmlTitle"> & ComponentProps<typeof Title>;
|
||||
export type NoteTitleProps = Pick<NoteFrontMatter, "slug" | "htmlTitle"> & ComponentProps<typeof Title>;
|
||||
|
||||
const NoteTitle = ({ slug, htmlTitle, ...rest }: NoteTitleProps) => (
|
||||
<Title {...rest}>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Link from "../Link";
|
||||
import Time from "../Time";
|
||||
import { styled } from "../../lib/styles/stitches.config";
|
||||
import type { NoteType } from "../../types";
|
||||
import type { NoteFrontMatter } from "../../types";
|
||||
|
||||
const Section = styled("section", {
|
||||
fontSize: "1.1em",
|
||||
@@ -54,13 +54,13 @@ const PostDate = styled(Time, {
|
||||
});
|
||||
|
||||
export type NotesListProps = {
|
||||
notesByYear: Record<string, NoteType["frontMatter"][]>;
|
||||
notesByYear: Record<string, NoteFrontMatter[]>;
|
||||
};
|
||||
|
||||
const NotesList = ({ notesByYear }: NotesListProps) => {
|
||||
const sections = [];
|
||||
|
||||
Object.entries(notesByYear).forEach(([year, notes]: [string, NoteType["frontMatter"][]]) => {
|
||||
Object.entries(notesByYear).forEach(([year, notes]: [string, NoteFrontMatter[]]) => {
|
||||
sections.push(
|
||||
<Section key={year}>
|
||||
<Year>{year}</Year>
|
||||
|
||||
@@ -3,7 +3,7 @@ import RelativeTime from "../RelativeTime";
|
||||
import { StarOcticon, ForkOcticon } from "../Icons";
|
||||
import { commafy } from "../../lib/helpers/format-number";
|
||||
import { styled } from "../../lib/styles/stitches.config";
|
||||
import type { RepositoryType } from "../../types";
|
||||
import type { Repository } from "../../types";
|
||||
|
||||
const Wrapper = styled("div", {
|
||||
width: "100%",
|
||||
@@ -68,7 +68,7 @@ const LanguageCircle = styled("span", {
|
||||
verticalAlign: "text-top",
|
||||
});
|
||||
|
||||
export type RepositoryCardProps = RepositoryType & {
|
||||
export type RepositoryCardProps = Repository & {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user