From 3884c656b8149fa37b5701c004cdeaf0fe86b242 Mon Sep 17 00:00:00 2001 From: Niall Maher Date: Sun, 12 Mar 2023 22:14:30 +0000 Subject: [PATCH] Metadata for user profile --- pages/[username].tsx | 131 +++++++++++++++++++++++--------------- pages/articles/[slug].tsx | 2 + 2 files changed, 82 insertions(+), 51 deletions(-) diff --git a/pages/[username].tsx b/pages/[username].tsx index a5cf6f6a..52aad86b 100644 --- a/pages/[username].tsx +++ b/pages/[username].tsx @@ -10,6 +10,7 @@ import prisma from "../server/db/client"; import Layout from "../components/Layout/Layout"; import ArticlePreview from "../components/ArticlePreview/ArticlePreview"; import PageHeading from "../components/PageHeading/PageHeading"; +import Head from "next/head"; const Profile: NextPage = ({ profile, @@ -20,60 +21,88 @@ const Profile: NextPage = ({ const { name, username, image, bio, posts } = profile; return ( - -
-
-
-
- {image && ( - {`Avatar - )} -
-
-

{name}

-

@{username}

-

{bio}

-
-
+ <> + + {`${name} - Codú`} + + + + + + + + + + + + + +
+
+
+
+ {image && ( + {`Avatar + )} +
+
+

{name}

+

@{username}

+

{bio}

+
+
- Published articles + Published articles - {posts.length ? ( - posts.map( - ({ slug, title, excerpt, readTimeMins, published, id }) => { - if (!published) return; - return ( - - ); - } - ) - ) : ( -

Nothing published yet... 🥲

- )} + {posts.length ? ( + posts.map( + ({ slug, title, excerpt, readTimeMins, published, id }) => { + if (!published) return; + return ( + + ); + } + ) + ) : ( +

Nothing published yet... 🥲

+ )} +
-
- + + ); }; diff --git a/pages/articles/[slug].tsx b/pages/articles/[slug].tsx index a59f1f44..3302f125 100644 --- a/pages/articles/[slug].tsx +++ b/pages/articles/[slug].tsx @@ -91,6 +91,7 @@ const ArticlePage: NextPage = ({ <> {post.title} +