mirror of
https://github.com/jordienr/zenblog.git
synced 2026-10-05 21:36:42 -04:00
improve hosted blog
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user