Skip to content

Commit e55c017

Browse files
committed
Remove some unclear readAt dates
1 parent c72579a commit e55c017

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

cms/content/library.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"title": "Accelerate: The Science of Lean Software and DevOps: Building and Scaling High Performing Technology Organizations",
7777
"author": "Nicole Forsgren, Jez Humble, Gene Kim",
7878
"category": "craft",
79-
"readAt": "2020-06-30",
8079
"image": "/static/library/accelerate.jpg",
8180
"status": "read",
8281
"language": "en"
@@ -139,7 +138,6 @@
139138
"title": "The First 90 Days. Updated And Expanded: Proven Straegies for Getting up to Speed faster and smarter",
140139
"author": "Michael D. Watkins",
141140
"category": "mental-models",
142-
"readAt": "2019-08-15",
143141
"image": "/static/library/the-first-90-days.jpg",
144142
"status": "read",
145143
"language": "en"
@@ -400,7 +398,6 @@
400398
"title": "Hackers & Painters: Big Ideas from the Computer Age",
401399
"author": "Paul Graham",
402400
"category": "uncategorized",
403-
"readAt": "2017-05-01",
404401
"image": "/static/library/hackers-and-painters.jpg",
405402
"status": "read",
406403
"language": "en"
@@ -409,7 +406,6 @@
409406
"title": "The Pragmatic Programmer: From Journeyman to Master",
410407
"author": "Andrew Hunt, David Thomas",
411408
"category": "uncategorized",
412-
"readAt": "2015-05-01",
413409
"image": "/static/library/pragmatic-programmer.jpg",
414410
"status": "read",
415411
"language": "en"
@@ -418,7 +414,6 @@
418414
"title": "Peopleware: Productive Projects and Teams",
419415
"author": "Tom DeMarco, Timothy Lister",
420416
"category": "uncategorized",
421-
"readAt": "2017-05-01",
422417
"image": "/static/library/peopleware.jpg",
423418
"status": "read",
424419
"language": "en"
@@ -427,7 +422,6 @@
427422
"title": "Design Patterns: Elements of Reusable Object-Oriented Software",
428423
"author": "Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides",
429424
"category": "reference",
430-
"readAt": "2016-05-01",
431425
"image": "/static/library/design-patterns.jpg",
432426
"status": "read",
433427
"language": "en"

cms/models/Book.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import z from "zod";
33
const BookSchema = z.object({
44
title: z.string(),
55
author: z.string(),
6-
readAt: z.iso.date(),
6+
readAt: z.iso.date().optional(),
77
category: z.union([
88
z.literal("foundational"),
99
z.literal("craft"),

components/Book/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ export function Book({ as = "div", book }: Readonly<BookProps>) {
3939
<dt className="sr-only">Author</dt>
4040
<dd className={styles.Author}>{book.author}</dd>
4141

42-
<dt className="sr-only">Read At</dt>
43-
<dd className={styles.Date}>last read {yearsAgo(new Date(book.readAt))}</dd>
42+
{book.readAt !== undefined && (
43+
<>
44+
<dt className="sr-only">Read At</dt>
45+
<dd className={styles.Date}>last read {yearsAgo(new Date(book.readAt))}</dd>
46+
</>
47+
)}
4448
</dl>
4549
</Komponent>
4650
);

0 commit comments

Comments
 (0)