From 76278124e9b43eec69248269e9054182d1754e37 Mon Sep 17 00:00:00 2001 From: Aidan Date: Fri, 31 Jan 2025 16:23:19 -0500 Subject: [PATCH] fix post link, use instead of , add bun instruction for setup complete, load categories from api for post create, fix margin on post title --- app/admin/page.tsx | 7 ++++--- app/admin/posts/new/page.tsx | 36 ++++++++++++++++++++++++++--------- app/admin/posts/page.tsx | 9 +++++---- app/posts/[slug]/page.tsx | 2 +- bun.lockb | Bin 253969 -> 253969 bytes server/setup.js | 7 ++++--- strings.json | 2 +- 7 files changed, 42 insertions(+), 21 deletions(-) diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 7cbe72b..3ebc693 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -1,5 +1,6 @@ 'use client'; +import Link from 'next/link'; import { useEffect, useState } from "react" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" @@ -52,7 +53,7 @@ export default function Home() { setPostCardLoading(false); throw new Error(strings.errorsUnknownError); } - } else if (data.count) { + } else if (data.count || data.count === 0) { console.log(strings.logsTotalPosts, data.count); setTotalPosts(data.count); setPostCardLoading(false); @@ -166,10 +167,10 @@ export default function Home() { diff --git a/app/posts/[slug]/page.tsx b/app/posts/[slug]/page.tsx index cbbe883..2e83a55 100644 --- a/app/posts/[slug]/page.tsx +++ b/app/posts/[slug]/page.tsx @@ -109,7 +109,7 @@ export default function PostPage() { return (
-

{postTitle}

+

{postTitle}

{strings.postPublishedOnLabel} {postDate}

diff --git a/bun.lockb b/bun.lockb index 94d963f5e3ef5aa21d417c37d5b3186f862b0af5..ee6f3dfdde001750b2b7e9dfd0b0440a88677320 100755 GIT binary patch delta 83 zcmV-Z0IdI!zz>nY4}gRLv;w?$0XUbvcLFg1IhXHu0)iVg004ae0012T0DwIf+ delta 83 zcmV-Z0IdI!zz>nY4}gRLv;w?$0XLVucLFg1IG68t0)iVf004ae0012T0DwIf { console.log("┌────────────────────────────────────────────────────┐"); console.log("│ ✓ SETUP COMPLETE │"); - console.log("├──────────────┬─────────────────────────────────────┤"); - console.log("│ START SERVER │ $ node index.js │"); - console.log("└──────────────┴─────────────────────────────────────┘") + console.log("├─────────────────────┬──────────────────────────────┤"); + console.log("│ START SERVER (NODE) │ $ node index.js │"); + console.log("│ START SERVER (BUN) │ $ bun index.js │") + console.log("└─────────────────────┴──────────────────────────────┘") db.close(); rl.close(); diff --git a/strings.json b/strings.json index 31fca14..95f080d 100644 --- a/strings.json +++ b/strings.json @@ -36,7 +36,7 @@ "newPostTitleFieldPlaceholder": "Enter post title", "newPostDescriptionFieldPlaceholder": "Enter post description", "newPostCategoryFieldPlaceholder": "Select a category", - "newPostSlugFieldPlaceholder": "Enter post slug (i.e. /example-slug)", + "newPostSlugFieldPlaceholder": "Enter post slug (ex: inputting example will create a post at example.com/posts/example)", "newUserNameFieldLabel": "Name", "newUserEmailFieldLabel": "Email",