diff --git a/web/src/app/icons/[icon]/opengraph-image.tsx b/web/src/app/icons/[icon]/opengraph-image.tsx index b7321e7b..03e2ab49 100644 --- a/web/src/app/icons/[icon]/opengraph-image.tsx +++ b/web/src/app/icons/[icon]/opengraph-image.tsx @@ -1,7 +1,7 @@ -import { getAllIcons } from "@/lib/api" -import { ImageResponse } from "next/og" import { readFile } from "node:fs/promises" import { join } from "node:path" +import { getAllIcons } from "@/lib/api" +import { ImageResponse } from "next/og" export const dynamic = "force-static" diff --git a/web/src/app/icons/[icon]/page.tsx b/web/src/app/icons/[icon]/page.tsx index 7f1ab712..99e7e02e 100644 --- a/web/src/app/icons/[icon]/page.tsx +++ b/web/src/app/icons/[icon]/page.tsx @@ -1,49 +1,44 @@ -import { IconDetails } from "@/components/icon-details"; -import { BASE_URL, WEB_URL } from "@/constants"; -import { getAllIcons, getAuthorData } from "@/lib/api"; -import type { Metadata, ResolvingMetadata } from "next"; -import { notFound } from "next/navigation"; +import { IconDetails } from "@/components/icon-details" +import { BASE_URL, WEB_URL } from "@/constants" +import { getAllIcons, getAuthorData } from "@/lib/api" +import type { Metadata, ResolvingMetadata } from "next" +import { notFound } from "next/navigation" -export const dynamicParams = false; +export const dynamicParams = false export async function generateStaticParams() { - const iconsData = await getAllIcons(); + const iconsData = await getAllIcons() return Object.keys(iconsData).map((icon) => ({ icon, - })); + })) } -export const dynamic = "force-static"; +export const dynamic = "force-static" type Props = { - params: Promise<{ icon: string }>; - searchParams: Promise<{ [key: string]: string | string[] | undefined }>; -}; + params: Promise<{ icon: string }> + searchParams: Promise<{ [key: string]: string | string[] | undefined }> +} -export async function generateMetadata( - { params, searchParams }: Props, - parent: ResolvingMetadata, -): Promise { - const { icon } = await params; - const iconsData = await getAllIcons(); +export async function generateMetadata({ params, searchParams }: Props, parent: ResolvingMetadata): Promise { + const { icon } = await params + const iconsData = await getAllIcons() if (!iconsData[icon]) { - notFound(); + notFound() } - const authorData = await getAuthorData(iconsData[icon].update.author.id); - const authorName = authorData.name || authorData.login; - const updateDate = new Date(iconsData[icon].update.timestamp); - const totalIcons = Object.keys(iconsData).length; + const authorData = await getAuthorData(iconsData[icon].update.author.id) + const authorName = authorData.name || authorData.login + const updateDate = new Date(iconsData[icon].update.timestamp) + const totalIcons = Object.keys(iconsData).length - console.debug( - `Generated metadata for ${icon} by ${authorName} (${authorData.html_url}) updated at ${updateDate.toLocaleString()}`, - ); + console.debug(`Generated metadata for ${icon} by ${authorName} (${authorData.html_url}) updated at ${updateDate.toLocaleString()}`) - const iconImageUrl = `${BASE_URL}/png/${icon}.png`; - const pageUrl = `${WEB_URL}/icons/${icon}`; + const iconImageUrl = `${BASE_URL}/png/${icon}.png` + const pageUrl = `${WEB_URL}/icons/${icon}` const formattedIconName = icon .split("-") .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) - .join(" "); + .join(" ") return { title: `${formattedIconName} Icon | Dashboard Icons`, @@ -77,15 +72,7 @@ export async function generateMetadata( publishedTime: updateDate.toISOString(), modifiedTime: updateDate.toISOString(), section: "Icons", - tags: [ - formattedIconName, - "dashboard icon", - "service icon", - "application icon", - "tool icon", - "web dashboard", - "app directory", - ], + tags: [formattedIconName, "dashboard icon", "service icon", "application icon", "tool icon", "web dashboard", "app directory"], }, twitter: { card: "summary_large_image", @@ -101,27 +88,19 @@ export async function generateMetadata( webp: `${BASE_URL}/webp/${icon}.webp`, }, }, - }; + } } -export default async function IconPage({ - params, -}: { params: Promise<{ icon: string }> }) { - const { icon } = await params; - const iconsData = await getAllIcons(); - const originalIconData = iconsData[icon]; +export default async function IconPage({ params }: { params: Promise<{ icon: string }> }) { + const { icon } = await params + const iconsData = await getAllIcons() + const originalIconData = iconsData[icon] if (!originalIconData) { - notFound(); + notFound() } - const authorData = await getAuthorData(originalIconData.update.author.id); + const authorData = await getAuthorData(originalIconData.update.author.id) - return ( - - ); + return } diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index 0734f2e8..910ef52b 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -7,8 +7,8 @@ import type { Metadata, Viewport } from "next" import { Inter } from "next/font/google" import { Toaster } from "sonner" import "./globals.css" -import { ThemeProvider } from "./theme-provider" import { getDescription, websiteTitle } from "@/constants" +import { ThemeProvider } from "./theme-provider" const inter = Inter({ variable: "--font-inter", diff --git a/web/src/components/header.tsx b/web/src/components/header.tsx index f3641d23..e0655916 100644 --- a/web/src/components/header.tsx +++ b/web/src/components/header.tsx @@ -58,11 +58,7 @@ export function Header() {
{/* Desktop search button */}
- diff --git a/web/src/components/magicui/number-ticker.tsx b/web/src/components/magicui/number-ticker.tsx index 39158e5b..f1bbc79d 100644 --- a/web/src/components/magicui/number-ticker.tsx +++ b/web/src/components/magicui/number-ticker.tsx @@ -1,64 +1,57 @@ -"use client"; +"use client" -import { useInView, useMotionValue, useSpring } from "motion/react"; -import { ComponentPropsWithoutRef, useEffect, useRef } from "react"; +import { useInView, useMotionValue, useSpring } from "motion/react" +import { type ComponentPropsWithoutRef, useEffect, useRef } from "react" -import { cn } from "@/lib/utils"; +import { cn } from "@/lib/utils" interface NumberTickerProps extends ComponentPropsWithoutRef<"span"> { - value: number; - startValue?: number; - direction?: "up" | "down"; - delay?: number; - decimalPlaces?: number; + value: number + startValue?: number + direction?: "up" | "down" + delay?: number + decimalPlaces?: number } export function NumberTicker({ - value, - startValue = 0, - direction = "up", - delay = 0, - className, - decimalPlaces = 0, - ...props + value, + startValue = 0, + direction = "up", + delay = 0, + className, + decimalPlaces = 0, + ...props }: NumberTickerProps) { - const ref = useRef(null); - const motionValue = useMotionValue(direction === "down" ? value : startValue); - const springValue = useSpring(motionValue, { - damping: 30, - stiffness: 200, - }); - const isInView = useInView(ref, { once: true, margin: "0px" }); + const ref = useRef(null) + const motionValue = useMotionValue(direction === "down" ? value : startValue) + const springValue = useSpring(motionValue, { + damping: 30, + stiffness: 200, + }) + const isInView = useInView(ref, { once: true, margin: "0px" }) - useEffect(() => { - if (isInView) { - const timer = setTimeout(() => { - motionValue.set(direction === "down" ? startValue : value); - }, delay * 1000); - return () => clearTimeout(timer); - } - }, [motionValue, isInView, delay, value, direction, startValue]); + useEffect(() => { + if (isInView) { + const timer = setTimeout(() => { + motionValue.set(direction === "down" ? startValue : value) + }, delay * 1000) + return () => clearTimeout(timer) + } + }, [motionValue, isInView, delay, value, direction, startValue]) - useEffect( - () => - springValue.on("change", (latest) => { - if (ref.current) { - ref.current.textContent = Number(latest.toFixed(decimalPlaces)).toString(); - } - }), - [springValue, decimalPlaces], - ); + useEffect( + () => + springValue.on("change", (latest) => { + if (ref.current) { + ref.current.textContent = Number(latest.toFixed(decimalPlaces)).toString() + } + }), + [springValue, decimalPlaces], + ) - return ( - - {startValue} - - ); + return ( + + {startValue} + + ) } diff --git a/web/src/components/theme-switcher.tsx b/web/src/components/theme-switcher.tsx index 12d6d537..46306889 100644 --- a/web/src/components/theme-switcher.tsx +++ b/web/src/components/theme-switcher.tsx @@ -18,11 +18,7 @@ export function ThemeSwitcher() { -