From 9435addd4550ec0678ab911566ddcaf30a9afb50 Mon Sep 17 00:00:00 2001 From: Sol Irvine Date: Mon, 21 Aug 2023 08:38:34 +0900 Subject: [PATCH] Update stories.tsx --- components/layout/stories.tsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/components/layout/stories.tsx b/components/layout/stories.tsx index 0b90cd73d..b88690c30 100644 --- a/components/layout/stories.tsx +++ b/components/layout/stories.tsx @@ -1,4 +1,5 @@ import clsx from 'clsx'; +import { format } from 'date-fns'; import { getBlog } from 'lib/shopify'; import Image from 'next/image'; import Link from 'next/link'; @@ -24,19 +25,14 @@ export default async function Stories({ if (!blog) return null; return ( -
-
+
+

stories

-
+
{blog?.articles?.map((article) => ( -
-
+
+
{!!article?.image?.url && ( )}
-
{article?.title}
-
{article?.excerpt}
+
+
+ {format(new Date(article?.publishedAt), 'yyyy-MM-dd')} +
+
{article?.title}
+
{article?.excerpt}
+
))}