From 739ee8a825294679fae3b801c440387aca68ed3f Mon Sep 17 00:00:00 2001 From: denshooter Date: Mon, 16 Feb 2026 01:39:01 +0100 Subject: [PATCH] fix: restore random nerdy quotes and hide empty project links Re-implemented random quote rotation in activity feed when idle. Added conditional rendering for project links box to declutter project pages. --- app/_ui/ProjectDetailClient.tsx | 65 +++++++++++++++++++++++---------- app/components/ActivityFeed.tsx | 45 ++++++++++++++++++----- 2 files changed, 81 insertions(+), 29 deletions(-) diff --git a/app/_ui/ProjectDetailClient.tsx b/app/_ui/ProjectDetailClient.tsx index 51abe32..3b89aca 100644 --- a/app/_ui/ProjectDetailClient.tsx +++ b/app/_ui/ProjectDetailClient.tsx @@ -111,26 +111,53 @@ export default function ProjectDetailClient({ -
-
-

Links

-
- {project.live && ( - - {project.button_live_label || tDetail("liveDemo")} - - - )} - {project.github && ( - - {project.button_github_label || tDetail("viewSource")} - - - )} -
-
+
-
+ + + {/* Quick Links Box - Only show if links exist */} + + {((project.live && project.live !== "#") || (project.github && project.github !== "#")) && ( + +
+ +

Links

+ +
+ + {project.live && project.live !== "#" && ( + + + + {project.button_live_label || tDetail("liveDemo")} + + + + + + )} + + {project.github && project.github !== "#" && ( + + + + {project.button_github_label || tDetail("viewSource")} + + + + + + )} + +
+ +
+ + )} + + + +

Stack

{project.tags.map((tag) => ( diff --git a/app/components/ActivityFeed.tsx b/app/components/ActivityFeed.tsx index ac31fbb..39252d6 100644 --- a/app/components/ActivityFeed.tsx +++ b/app/components/ActivityFeed.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"; import Image from "next/image"; import { motion } from "framer-motion"; -import { Code2, Disc3, Gamepad2, Zap, BookOpen, Quote } from "lucide-react"; +import { Code2, Disc3, Gamepad2, Zap, Quote as QuoteIcon } from "lucide-react"; interface StatusData { status: { text: string; color: string; }; @@ -13,17 +13,39 @@ interface StatusData { customActivities?: Record; } +const techQuotes = [ + { content: "Computer Science is no more about computers than astronomy is about telescopes.", author: "Edsger W. Dijkstra" }, + { content: "Simplicity is prerequisite for reliability.", author: "Edsger W. Dijkstra" }, + { content: "If debugging is the process of removing software bugs, then programming must be the process of putting them in.", author: "Edsger W. Dijkstra" }, + { content: "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies.", author: "Tony Hoare" }, + { content: "Deleted code is debugged code.", author: "Jeff Sickel" }, + { content: "Walking on water and developing software from a specification are easy if both are frozen.", author: "Edward V. Berard" }, + { content: "Code never lies, comments sometimes do.", author: "Ron Jeffries" }, + { content: "I have no special talent. I am only passionately curious.", author: "Albert Einstein" }, + { content: "No code is faster than no code.", author: "Kevlin Henney" }, + { content: "First, solve the problem. Then, write the code.", author: "John Johnson" } +]; + +function getSafeGamingText(details: string | number | undefined, state: string | number | undefined, fallback: string): string { + if (typeof details === 'string' && details.trim().length > 0) return details; + if (typeof state === 'string' && state.trim().length > 0) return state; + if (typeof details === 'number' && !isNaN(details)) return String(details); + if (typeof state === 'number' && !isNaN(state)) return String(state); + return fallback; +} + export default function ActivityFeed({ - onActivityChange, - idleQuote + onActivityChange }: { onActivityChange?: (active: boolean) => void; - idleQuote?: string; }) { const [data, setData] = useState(null); const [hasActivity, setHasActivity] = useState(false); + const [randomQuote, setRandomQuote] = useState(techQuotes[0]); useEffect(() => { + setRandomQuote(techQuotes[Math.floor(Math.random() * techQuotes.length)]); + const fetchData = async () => { try { const res = await fetch("/api/n8n/status"); @@ -59,13 +81,16 @@ export default function ActivityFeed({ className="h-full flex flex-col justify-center space-y-6" >
- +
-

- “{idleQuote || "Gerade am Planen des nächsten großen Projekts."}” -

-
- Currently Idle +
+

+ “{randomQuote.content}” +

+

— {randomQuote.author}

+
+
+ Currently Thinking
);