From 275bdc1332c4583a1d754c6e55d7a181f893f8b0 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Thu, 17 Apr 2025 11:38:32 +0200 Subject: [PATCH] rework recently-added-icons --- web/src/app/page.tsx | 2 +- web/src/components/recently-added-icons.tsx | 38 +++++++-------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/web/src/app/page.tsx b/web/src/app/page.tsx index 926917de..b48b12f9 100644 --- a/web/src/app/page.tsx +++ b/web/src/app/page.tsx @@ -39,7 +39,7 @@ export async function generateMetadata(): Promise { export default async function Home() { const { totalIcons } = await getTotalIcons() - const recentIcons = await getRecentlyAddedIcons(8) + const recentIcons = await getRecentlyAddedIcons(10) return (
diff --git a/web/src/components/recently-added-icons.tsx b/web/src/components/recently-added-icons.tsx index 959e5f36..491e7b7a 100644 --- a/web/src/components/recently-added-icons.tsx +++ b/web/src/components/recently-added-icons.tsx @@ -5,7 +5,6 @@ import { BASE_URL } from "@/constants"; import { cn } from "@/lib/utils"; import type { Icon, IconWithName } from "@/types/icons"; import { format, isToday, isYesterday } from "date-fns"; -import { motion } from "framer-motion"; import { ArrowRight, Clock, ExternalLink } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; @@ -32,23 +31,17 @@ export function RecentlyAddedIcons({ icons }: { icons: IconWithName[] }) { + /> -
- +
+

Recently Added Icons

Check out the latest additions to our collection.

- +
@@ -69,13 +62,7 @@ export function RecentlyAddedIcons({ icons }: { icons: IconWithName[] }) {
- +
- +
); @@ -102,33 +89,32 @@ function RecentIconCard({ prefetch={false} href={`/icons/${name}`} className={cn( - "group flex flex-col items-center p-3 sm:p-4 rounded-xl border border-border bg-background/95 dark:bg-background/80", - "hover:border-rose-500 hover:bg-rose-500/10 dark:hover:bg-rose-900/30 dark:hover:border-rose-500", + "flex flex-col items-center p-3 sm:p-4 rounded-xl border border-border bg-background/95 dark:bg-background/80", "transition-all duration-300 hover:shadow-lg hover:shadow-rose-500/5 relative overflow-hidden hover-lift", "w-36 mx-2", )} > -
+
{`${name}
- + {name.replace(/-/g, " ")}
- + {formatIconDate(data.update.timestamp)}
-
+