This commit is contained in:
Jordi Enric
2024-03-09 16:40:46 +01:00
parent 9d5f4be31a
commit 1da3df2bfb
7 changed files with 23 additions and 28 deletions
+1 -5
View File
@@ -8,7 +8,7 @@ import React, { PropsWithChildren } from "react";
type Props = {};
export const dynamic = "force-dynamic";
export const revalidate = 60;
const layout = async ({
children,
params,
@@ -19,10 +19,6 @@ const layout = async ({
}>) => {
const posts = await docs.posts.getAll();
// const sortedPosts = posts.sort((a, b) => {
// return a.metadata - b.metadata.order;
// });
return (
<div className="mx-auto flex max-h-screen max-w-6xl">
<aside className="flex min-h-screen min-w-[16rem] flex-col overflow-auto">
-2
View File
@@ -12,6 +12,4 @@ export const getBlogClient = () => {
export const docs = createClient<{ metadata: { order: number } }>({
blogId: "12cc7bb4-4ea8-452d-a17d-5a15b148ae33",
debug: true,
_url: "http://localhost:3000/api/public",
});
@@ -12,12 +12,15 @@ type MetadataItem = {
type Props = {
metadata?: MetadataItem[];
selectedTags: string[];
published_at?: string;
onChange: ({
metadata,
tags,
published_at,
}: {
metadata: MetadataItem[];
tags: string[];
published_at?: string;
}) => void;
};
@@ -57,9 +60,23 @@ const EditorSettings = (props: Props) => {
};
return (
<div className="prose-sm prose-h2:font-bold prose-h2:text-sm">
<div className="prose prose-h2:font-medium prose-h2:text-sm prose-h2:font-mono">
<section className="mt-2">
<h2 className="mt-2 border-b pb-2">Published date</h2>
<Input
type="date"
name="published_at"
onChange={(e) => {
props.onChange({
tags: selectedTags,
metadata,
published_at: e.target.value,
});
}}
/>
</section>
<section>
<h2 className="m-0 border-b pb-2">Custom metadata</h2>
<h2 className="m-0 mt-8 border-b pb-2">Custom metadata</h2>
<div className="text-sm font-medium text-slate-700">
<div className="flex items-center py-2 text-xs text-slate-500 *:p-1">
@@ -35,7 +35,7 @@ const TagSelect = (props: Props) => {
<div>
<div>
<div className="flex items-center justify-between border-b">
<h2 className="">Tags</h2>
<h2 className="mb-0 pb-2">Tags</h2>
<Dialog>
<DialogTrigger asChild>
<Button
+1 -6
View File
@@ -7,10 +7,5 @@ const Logo = () => (
);
export default function ZendoLogo() {
return (
<div className="text-lg font-bold tracking-tight">
<span className="mr-2 text-2xl">⛩️</span>
zenblog
</div>
);
return <div className="text-lg font-bold tracking-tight">zenblog</div>;
}
@@ -116,7 +116,7 @@ export default function BlogPosts() {
</div>
</div>
<TabsContent value="posts">
<div className="mt-2 rounded-xl border bg-white py-2 shadow-sm">
<div className="mt-2 rounded-xl border border-b-2 bg-white py-2">
{posts.length === 0 && (
<div className="p-12 py-32 text-center">
<div className="text-2xl">✏️</div>
-11
View File
@@ -13,17 +13,6 @@ module.exports = {
"./src/**/*.{ts,tsx}",
],
theme: {
// fontWeight: {
// thin: '100',
// extralight: '200',
// light: '300',
// normal: '400',
// medium: '500',
// thicc: '600',
// thiccc: '700',
// thicccc: '800',
// thiccccc: '900',
// },
border: {
DEFAULT: "0.3px solid var(--border-color)",
1: "1px",