mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 11:46:39 -04:00
consistent use of arrow functions/default exports
This commit is contained in:
@ -9,7 +9,7 @@ type NoteProps = {
|
||||
slug: string;
|
||||
};
|
||||
|
||||
export default function List({ notesByYear }) {
|
||||
const List = ({ notesByYear }) => {
|
||||
const sections = [];
|
||||
|
||||
Object.entries(notesByYear).forEach(([year, notes]: [string, NoteProps[]]) => {
|
||||
@ -36,4 +36,6 @@ export default function List({ notesByYear }) {
|
||||
const reversed = sections.reverse();
|
||||
|
||||
return <>{reversed}</>;
|
||||
}
|
||||
};
|
||||
|
||||
export default List;
|
||||
|
@ -13,58 +13,58 @@ export type Props = {
|
||||
tags?: string[];
|
||||
};
|
||||
|
||||
export default function Meta({ title, date, slug, tags = [] }: Props) {
|
||||
return (
|
||||
<>
|
||||
<div className={styles.meta}>
|
||||
<div className={styles.date}>
|
||||
<span>
|
||||
<DateIcon className={`icon ${styles.icon}`} />
|
||||
</span>
|
||||
<span title={format(parseISO(date), "PPppp")}>
|
||||
<Link href={`/notes/${slug}/`}>{format(parseISO(date), "MMMM d, yyyy")}</Link>
|
||||
</span>
|
||||
</div>
|
||||
{tags.length > 0 && (
|
||||
<div className={styles.tags}>
|
||||
<span>
|
||||
<TagIcon className={`icon ${styles.icon}`} />
|
||||
</span>
|
||||
{tags.map((tag) => (
|
||||
<span key={tag} className={styles.tag}>
|
||||
{tag}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<span>
|
||||
<EditIcon className={`icon ${styles.icon}`} />
|
||||
</span>
|
||||
<span>
|
||||
<a
|
||||
href={`https://github.com/${config.githubRepo}/blob/main/notes/${slug}.mdx`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
title={`Edit "${title}" on GitHub`}
|
||||
>
|
||||
Improve This Post
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>
|
||||
<ViewsIcon className={`icon ${styles.icon}`} />
|
||||
</span>
|
||||
<Hits slug={`notes/${slug}`} />
|
||||
</div>
|
||||
const Meta = ({ title, date, slug, tags = [] }: Props) => (
|
||||
<>
|
||||
<div className={styles.meta}>
|
||||
<div className={styles.date}>
|
||||
<span>
|
||||
<DateIcon className={`icon ${styles.icon}`} />
|
||||
</span>
|
||||
<span title={format(parseISO(date), "PPppp")}>
|
||||
<Link href={`/notes/${slug}/`}>{format(parseISO(date), "MMMM d, yyyy")}</Link>
|
||||
</span>
|
||||
</div>
|
||||
{tags.length > 0 && (
|
||||
<div className={styles.tags}>
|
||||
<span>
|
||||
<TagIcon className={`icon ${styles.icon}`} />
|
||||
</span>
|
||||
{tags.map((tag) => (
|
||||
<span key={tag} className={styles.tag}>
|
||||
{tag}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<span>
|
||||
<EditIcon className={`icon ${styles.icon}`} />
|
||||
</span>
|
||||
<span>
|
||||
<a
|
||||
href={`https://github.com/${config.githubRepo}/blob/main/notes/${slug}.mdx`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
title={`Edit "${title}" on GitHub`}
|
||||
>
|
||||
Improve This Post
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>
|
||||
<ViewsIcon className={`icon ${styles.icon}`} />
|
||||
</span>
|
||||
<Hits slug={`notes/${slug}`} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1 className={styles.title}>
|
||||
<Link href={`/notes/${slug}/`}>
|
||||
<a>{title}</a>
|
||||
</Link>
|
||||
</h1>
|
||||
</>
|
||||
);
|
||||
}
|
||||
<h1 className={styles.title}>
|
||||
<Link href={`/notes/${slug}/`}>
|
||||
<a>{title}</a>
|
||||
</Link>
|
||||
</h1>
|
||||
</>
|
||||
);
|
||||
|
||||
export default Meta;
|
||||
|
Reference in New Issue
Block a user