diff --git a/src/app/news/page.tsx b/src/app/news/page.tsx index 26f5714..43819bc 100644 --- a/src/app/news/page.tsx +++ b/src/app/news/page.tsx @@ -1,6 +1,7 @@ import Container from "@/components/layout/container"; import Header from "@/components/layout/header"; import MainWrapper from "@/components/layout/main-wrapper"; +import NewsList from "@/components/news/list"; import PageHeader from "@/components/page-header"; export default function Homepage() { @@ -8,8 +9,13 @@ export default function Homepage() {
- - asdf + + + +
); diff --git a/src/components/features/implementations.tsx b/src/components/features/implementations.tsx index b7efdb4..011c064 100644 --- a/src/components/features/implementations.tsx +++ b/src/components/features/implementations.tsx @@ -6,7 +6,7 @@ import useGetContentfulData from "@/hooks/use-get-contentful-data"; export default function Implementations() { const data = useGetContentfulData("integration"); - console.log("data", data); + return (
{data && diff --git a/src/components/news/list.tsx b/src/components/news/list.tsx new file mode 100644 index 0000000..c233a68 --- /dev/null +++ b/src/components/news/list.tsx @@ -0,0 +1,59 @@ +"use client"; + +import RichTextContent from "../rich-text-content"; +import { UserGroupIcon } from "@heroicons/react/20/solid"; +import { formatDate } from "@/lib/format-date"; +import useGetContentfulData from "@/hooks/use-get-contentful-data"; + +export default function NewsList() { + const data = useGetContentfulData("newsItem"); + console.log("data", data); + + return ( +
+
+
+
+ {data.map(({ fields, sys }: { fields: any; sys: any }) => ( +
+
+ + + {fields.title} + +
+
+

+ {/* */} + {fields.title} +

+ +
+
+ +
+

+ + + {fields.author} + +

+

Hyku Administrator

+
+
+
+ ))} +
+
+
+
+ ); +} diff --git a/src/lib/format-date.ts b/src/lib/format-date.ts new file mode 100644 index 0000000..d3dc9a4 --- /dev/null +++ b/src/lib/format-date.ts @@ -0,0 +1,7 @@ +export function formatDate(date: string) { + return new Date(date).toLocaleDateString("en-US", { + year: "numeric", + month: "long", + day: "numeric", + }); +} diff --git a/src/lib/types.ts b/src/lib/types.ts new file mode 100644 index 0000000..e69de29