mirror of
https://github.com/walkxcode/dashboard-icons.git
synced 2025-11-19 10:07:29 +01:00
chore: lint && format codebase
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import type { Metadata } from "next"
|
import type { Metadata } from "next"
|
||||||
import { Suspense } from "react"
|
import { Suspense } from "react"
|
||||||
import { ExperimentalWarning } from "@/components/experimental-warning"
|
|
||||||
import { CommunityIconSearch } from "@/components/community-icon-search"
|
import { CommunityIconSearch } from "@/components/community-icon-search"
|
||||||
|
import { ExperimentalWarning } from "@/components/experimental-warning"
|
||||||
import { BASE_URL } from "@/constants"
|
import { BASE_URL } from "@/constants"
|
||||||
import { getCommunitySubmissions } from "@/lib/community"
|
import { getCommunitySubmissions } from "@/lib/community"
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { getAllIcons } from "@/lib/api"
|
|||||||
export const dynamic = "force-static"
|
export const dynamic = "force-static"
|
||||||
export const revalidate = false
|
export const revalidate = false
|
||||||
|
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
export async function generateStaticParams() {
|
||||||
const iconsData = await getAllIcons()
|
const iconsData = await getAllIcons()
|
||||||
if (process.env.CI_MODE === "false") {
|
if (process.env.CI_MODE === "false") {
|
||||||
@@ -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
|
// Convert the image data to a data URL or use placeholder
|
||||||
const iconUrl = iconData
|
const iconUrl = iconData ? `data:image/png;base64,${iconData.toString("base64")}` : null
|
||||||
? `data:image/png;base64,${iconData.toString("base64")}`
|
|
||||||
: null
|
|
||||||
|
|
||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import { useForm } from "@tanstack/react-form"
|
|||||||
import { Check, FileImage, FileType, Plus, X } from "lucide-react"
|
import { Check, FileImage, FileType, Plus, X } from "lucide-react"
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner"
|
||||||
import { IconNameCombobox } from "@/components/icon-name-combobox"
|
import { revalidateAllSubmissions } from "@/app/actions/submissions"
|
||||||
import { ExperimentalWarning } from "@/components/experimental-warning"
|
import { ExperimentalWarning } from "@/components/experimental-warning"
|
||||||
|
import { IconNameCombobox } from "@/components/icon-name-combobox"
|
||||||
import {
|
import {
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
AlertDialogAction,
|
AlertDialogAction,
|
||||||
@@ -26,7 +27,6 @@ import { Dropzone, DropzoneContent, DropzoneEmptyState } from "@/components/ui/s
|
|||||||
import { Textarea } from "@/components/ui/textarea"
|
import { Textarea } from "@/components/ui/textarea"
|
||||||
import { useExistingIconNames } from "@/hooks/use-submissions"
|
import { useExistingIconNames } from "@/hooks/use-submissions"
|
||||||
import { pb } from "@/lib/pb"
|
import { pb } from "@/lib/pb"
|
||||||
import { revalidateAllSubmissions } from "@/app/actions/submissions"
|
|
||||||
|
|
||||||
interface VariantConfig {
|
interface VariantConfig {
|
||||||
id: string
|
id: string
|
||||||
@@ -298,7 +298,8 @@ export function AdvancedIconSubmissionFormTanStack() {
|
|||||||
<AlertDialogHeader>
|
<AlertDialogHeader>
|
||||||
<AlertDialogTitle>Confirm Submission</AlertDialogTitle>
|
<AlertDialogTitle>Confirm Submission</AlertDialogTitle>
|
||||||
<AlertDialogDescription>
|
<AlertDialogDescription>
|
||||||
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.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Do you still want to proceed with submitting your icon?
|
Do you still want to proceed with submitting your icon?
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import Link from "next/link"
|
|||||||
import type React from "react"
|
import type React from "react"
|
||||||
import { useCallback, useState } from "react"
|
import { useCallback, useState } from "react"
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner"
|
||||||
|
import { revalidateAllSubmissions } from "@/app/actions/submissions"
|
||||||
import { IconNameCombobox } from "@/components/icon-name-combobox"
|
import { IconNameCombobox } from "@/components/icon-name-combobox"
|
||||||
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
|
||||||
import { Button } from "@/components/ui/button"
|
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 { BASE_URL, REPO_PATH } from "@/constants"
|
||||||
import { pb } from "@/lib/pb"
|
import { pb } from "@/lib/pb"
|
||||||
import { formatIconName } from "@/lib/utils"
|
import { formatIconName } from "@/lib/utils"
|
||||||
import { revalidateAllSubmissions } from "@/app/actions/submissions"
|
|
||||||
import { MagicCard } from "./magicui/magic-card"
|
import { MagicCard } from "./magicui/magic-card"
|
||||||
import { Badge } from "./ui/badge"
|
import { Badge } from "./ui/badge"
|
||||||
import { Dropzone, DropzoneContent, DropzoneEmptyState } from "./ui/shadcn-io/dropzone"
|
import { Dropzone, DropzoneContent, DropzoneEmptyState } from "./ui/shadcn-io/dropzone"
|
||||||
|
|||||||
@@ -16,9 +16,7 @@ export function ExperimentalWarning({ message }: ExperimentalWarningProps) {
|
|||||||
<AlertTriangle className="text-amber-600 dark:text-amber-500 size-8" />
|
<AlertTriangle className="text-amber-600 dark:text-amber-500 size-8" />
|
||||||
<div className="col-start-2 space-y-4">
|
<div className="col-start-2 space-y-4">
|
||||||
<AlertTitle className="text-amber-900 dark:text-amber-100 text-2xl font-bold">Experimental Feature</AlertTitle>
|
<AlertTitle className="text-amber-900 dark:text-amber-100 text-2xl font-bold">Experimental Feature</AlertTitle>
|
||||||
<AlertDescription className="text-amber-800 dark:text-amber-200 text-base leading-relaxed">
|
<AlertDescription className="text-amber-800 dark:text-amber-200 text-base leading-relaxed">{defaultMessage}</AlertDescription>
|
||||||
{defaultMessage}
|
|
||||||
</AlertDescription>
|
|
||||||
<Button className="feedback-button mt-4" variant="outline" size="lg">
|
<Button className="feedback-button mt-4" variant="outline" size="lg">
|
||||||
Send feedback
|
Send feedback
|
||||||
</Button>
|
</Button>
|
||||||
@@ -26,4 +24,3 @@ export function ExperimentalWarning({ message }: ExperimentalWarningProps) {
|
|||||||
</Alert>
|
</Alert>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner"
|
||||||
|
import { revalidateAllSubmissions } from "@/app/actions/submissions"
|
||||||
import { getAllIcons } from "@/lib/api"
|
import { getAllIcons } from "@/lib/api"
|
||||||
import { pb, type Submission } from "@/lib/pb"
|
import { pb, type Submission } from "@/lib/pb"
|
||||||
import { revalidateAllSubmissions } from "@/app/actions/submissions"
|
|
||||||
|
|
||||||
// Query key factory
|
// Query key factory
|
||||||
export const submissionKeys = {
|
export const submissionKeys = {
|
||||||
|
|||||||
@@ -132,14 +132,10 @@ async function fetchAuthorData(authorId: number) {
|
|||||||
* across multiple page builds and requests.
|
* across multiple page builds and requests.
|
||||||
*/
|
*/
|
||||||
export async function getAuthorData(authorId: number): Promise<AuthorData> {
|
export async function getAuthorData(authorId: number): Promise<AuthorData> {
|
||||||
return unstable_cache(
|
return unstable_cache(async () => await fetchAuthorData(authorId), [`author-${authorId}`], {
|
||||||
async () => await fetchAuthorData(authorId),
|
revalidate: 86400,
|
||||||
[`author-${authorId}`],
|
tags: ["authors", `author-${authorId}`],
|
||||||
{
|
})()
|
||||||
revalidate: 86400,
|
|
||||||
tags: ["authors", `author-${authorId}`],
|
|
||||||
}
|
|
||||||
)()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,6 +10,3 @@ export class ApiError extends Error {
|
|||||||
this.status = status
|
this.status = status
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user