From 3f85c496ed6311f654389399414fc0d5c14d5736 Mon Sep 17 00:00:00 2001 From: Elliott Minns Date: Fri, 27 Jun 2025 16:23:29 -0500 Subject: [PATCH] feat: highlight creator messages --- next.config.ts | 3 +++ src/app/page.tsx | 64 ++++++++++++++++++++++++++++++------------------ 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/next.config.ts b/next.config.ts index f917d61..4c47d0f 100644 --- a/next.config.ts +++ b/next.config.ts @@ -4,6 +4,9 @@ const nextConfig: NextConfig = { eslint: { ignoreDuringBuilds: true, }, + env: { + CREATOR_USERNAME: process.env.CREATOR_USERNAME, + }, }; export default nextConfig; diff --git a/src/app/page.tsx b/src/app/page.tsx index eced001..999375c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -11,6 +11,7 @@ import { getGuestbookEntries, createGuestbookEntry } from '@/actions/guestbook'; import { getUserPreferences, updateIgnoredUsers, getUserIdByUsername } from '@/actions/preferences'; import { Button } from '@/components/ui/button'; import { MessageSquare, Sparkles, KeyRound, RefreshCw, ChevronLeft, ChevronRight } from 'lucide-react'; +import { cn } from '@/lib/utils'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; interface GuestbookEntryType { @@ -39,6 +40,7 @@ export default function Home() { const router = useRouter(); const { data: session, isPending } = useSession(); const queryClient = useQueryClient(); + const creatorUsername = process.env.CREATOR_USERNAME; const [currentPage, setCurrentPage] = useState(1); const [showOtpInput, setShowOtpInput] = useState(false); @@ -185,7 +187,7 @@ export default function Home() { const filteredEntries = showIgnored ? entries : entries.filter(entry => { - const username = entry.displayUsername || entry.username || entry.name; + const username = entry.displayUsername || entry.username || entry.name || ''; return !username || !ignoredUsers.includes(username); }); @@ -349,29 +351,43 @@ export default function Home() { ) : (
- {filteredEntries.map((entry, index) => ( -
- -
- ))} + {filteredEntries.map((entry, index) => { + const username = entry.displayUsername || entry.username || entry.name || ''; + const isCreator = username === creatorUsername; + return ( +
+
+ +
+
+ ); + })}
)}