improve hosted blog

This commit is contained in:
Jordi Enric
2024-04-09 21:11:26 +02:00
parent f22399873d
commit 34b38411ce
3 changed files with 12 additions and 14 deletions
+11 -1
View File
@@ -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 (
<div className="mx-auto max-w-xl px-2 py-8">
<h2 className="mb-4 p-2 font-medium">Blog</h2>
<h2 className="mb-4 flex items-center gap-2 p-2 font-medium">
<span className="text-xl">{blog?.emoji}</span>
<span>{blog?.title}</span>
</h2>
{posts.data?.map((post) => (
<Link
className="group grid grid-cols-6 border-b border-transparent p-2 transition-all hover:border-slate-300"
-13
View File
@@ -1,13 +0,0 @@
import React from "react";
type Props = {};
const Pub = (props: Props) => {
return (
<div>
<pre>{JSON.stringify(props, null, 2)}</pre>
</div>
);
};
export default Pub;
+1
View File
@@ -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