From 2863cfd96d7e7d0c383832a707c179aa52960d84 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Mon, 17 Nov 2025 10:02:19 +0100 Subject: [PATCH] chore: lint && format codebase --- web/src/app/community/[icon]/opengraph-image.tsx | 4 ++-- web/src/app/community/page.tsx | 2 +- web/src/app/icons/[icon]/opengraph-image.tsx | 9 +++------ .../advanced-icon-submission-form-tanstack.tsx | 7 ++++--- web/src/components/editable-icon-details.tsx | 2 +- web/src/components/experimental-warning.tsx | 5 +---- web/src/hooks/use-submissions.ts | 2 +- web/src/lib/api.ts | 14 +++++--------- web/src/lib/errors.ts | 3 --- 9 files changed, 18 insertions(+), 30 deletions(-) diff --git a/web/src/app/community/[icon]/opengraph-image.tsx b/web/src/app/community/[icon]/opengraph-image.tsx index 54db9519..61da7c4c 100644 --- a/web/src/app/community/[icon]/opengraph-image.tsx +++ b/web/src/app/community/[icon]/opengraph-image.tsx @@ -24,7 +24,7 @@ export const size = { export default async function Image({ params }: { params: Promise<{ icon: string }> }) { const { icon } = await params - + if (!icon) { return new ImageResponse(
}) { const { icon } = await params - + if (!icon) { console.error(`[Opengraph Image] Icon not found for ${icon}`) return new ImageResponse( @@ -50,7 +49,7 @@ export default async function Image({ params }: { params: Promise<{ icon: string { ...size }, ) } - + const iconsData = await getAllIcons() const totalIcons = Object.keys(iconsData).length const index = Object.keys(iconsData).indexOf(icon) @@ -72,9 +71,7 @@ export default async function Image({ params }: { params: Promise<{ icon: string } // Convert the image data to a data URL or use placeholder - const iconUrl = iconData - ? `data:image/png;base64,${iconData.toString("base64")}` - : null + const iconUrl = iconData ? `data:image/png;base64,${iconData.toString("base64")}` : null return new ImageResponse(
Confirm Submission - This icon submission form is a work-in-progress and is currently in an experimentation phase. Your submission will not be reviewed or processed at this time. We're using this to gather feedback and improve the experience. + This icon submission form is a work-in-progress and is currently in an experimentation phase. Your submission will not be + reviewed or processed at this time. We're using this to gather feedback and improve the experience.

Do you still want to proceed with submitting your icon? diff --git a/web/src/components/editable-icon-details.tsx b/web/src/components/editable-icon-details.tsx index 49cce36c..8db40d7d 100644 --- a/web/src/components/editable-icon-details.tsx +++ b/web/src/components/editable-icon-details.tsx @@ -8,6 +8,7 @@ import Link from "next/link" import type React from "react" import { useCallback, useState } from "react" import { toast } from "sonner" +import { revalidateAllSubmissions } from "@/app/actions/submissions" import { IconNameCombobox } from "@/components/icon-name-combobox" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Button } from "@/components/ui/button" @@ -18,7 +19,6 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/comp import { BASE_URL, REPO_PATH } from "@/constants" import { pb } from "@/lib/pb" import { formatIconName } from "@/lib/utils" -import { revalidateAllSubmissions } from "@/app/actions/submissions" import { MagicCard } from "./magicui/magic-card" import { Badge } from "./ui/badge" import { Dropzone, DropzoneContent, DropzoneEmptyState } from "./ui/shadcn-io/dropzone" diff --git a/web/src/components/experimental-warning.tsx b/web/src/components/experimental-warning.tsx index d2448beb..9cab8d5e 100644 --- a/web/src/components/experimental-warning.tsx +++ b/web/src/components/experimental-warning.tsx @@ -16,9 +16,7 @@ export function ExperimentalWarning({ message }: ExperimentalWarningProps) {
Experimental Feature - - {defaultMessage} - + {defaultMessage} @@ -26,4 +24,3 @@ export function ExperimentalWarning({ message }: ExperimentalWarningProps) { ) } - diff --git a/web/src/hooks/use-submissions.ts b/web/src/hooks/use-submissions.ts index 53d656cf..62b674cb 100644 --- a/web/src/hooks/use-submissions.ts +++ b/web/src/hooks/use-submissions.ts @@ -1,8 +1,8 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query" import { toast } from "sonner" +import { revalidateAllSubmissions } from "@/app/actions/submissions" import { getAllIcons } from "@/lib/api" import { pb, type Submission } from "@/lib/pb" -import { revalidateAllSubmissions } from "@/app/actions/submissions" // Query key factory export const submissionKeys = { diff --git a/web/src/lib/api.ts b/web/src/lib/api.ts index 6eebc5f0..7bbccadc 100644 --- a/web/src/lib/api.ts +++ b/web/src/lib/api.ts @@ -127,19 +127,15 @@ async function fetchAuthorData(authorId: number) { * Uses unstable_cache with tags for on-demand revalidation * Revalidates every 86400 seconds (24 hours) * Cache key: author-{authorId} - * + * * This prevents hitting GitHub API rate limits by caching author data * across multiple page builds and requests. */ export async function getAuthorData(authorId: number): Promise { - return unstable_cache( - async () => await fetchAuthorData(authorId), - [`author-${authorId}`], - { - revalidate: 86400, - tags: ["authors", `author-${authorId}`], - } - )() + return unstable_cache(async () => await fetchAuthorData(authorId), [`author-${authorId}`], { + revalidate: 86400, + tags: ["authors", `author-${authorId}`], + })() } /** diff --git a/web/src/lib/errors.ts b/web/src/lib/errors.ts index 7c7b203a..e1f6eceb 100644 --- a/web/src/lib/errors.ts +++ b/web/src/lib/errors.ts @@ -10,6 +10,3 @@ export class ApiError extends Error { this.status = status } } - - -