From 34b38411ce0cf5fa26978ed17442c45bc109cfc6 Mon Sep 17 00:00:00 2001 From: Jordi Enric Date: Tue, 9 Apr 2024 21:11:26 +0200 Subject: [PATCH] improve hosted blog --- apps/zendo/app/pub/[subdomain]/page.tsx | 12 +++++++++++- apps/zendo/app/pub/page.tsx | 13 ------------- todo/mvp.md | 1 + 3 files changed, 12 insertions(+), 14 deletions(-) delete mode 100644 apps/zendo/app/pub/page.tsx diff --git a/apps/zendo/app/pub/[subdomain]/page.tsx b/apps/zendo/app/pub/[subdomain]/page.tsx index 2c4c992..f7ec34f 100644 --- a/apps/zendo/app/pub/[subdomain]/page.tsx +++ b/apps/zendo/app/pub/[subdomain]/page.tsx @@ -8,6 +8,12 @@ async function HostedBlog({ params: { subdomain: string }; }) { const supa = createClient(); + const { data: blog } = await supa + .from("blogs") + .select("title, emoji") + .eq("slug", subdomain) + .single(); + const posts = await supa .from("public_posts_v1") .select("title, slug, published_at") @@ -24,7 +30,11 @@ async function HostedBlog({ return (
-

Blog

+

+ {blog?.emoji} + {blog?.title} +

+ {posts.data?.map((post) => ( { - return ( -
-
{JSON.stringify(props, null, 2)}
-
- ); -}; - -export default Pub; diff --git a/todo/mvp.md b/todo/mvp.md index 55b5b23..61490b9 100644 --- a/todo/mvp.md +++ b/todo/mvp.md @@ -55,3 +55,4 @@ - Prevent users from leaving the page when they have unsaved changes - Save posts/create in localstorage so its not lost when you reload the page goddammit +- Apple pay