From 8a7215e69f4e90a1a28399e260ed7529c01ba42e Mon Sep 17 00:00:00 2001 From: fretchen Date: Thu, 30 Jul 2026 22:42:36 +0200 Subject: [PATCH 1/7] Fix typing --- website/components/FacilitatorApproval.tsx | 4 ++- website/components/ImageModal.tsx | 2 +- website/components/MarkdownWithLatex.tsx | 7 ++-- website/components/Post.tsx | 2 +- website/components/SimpleCollectButton.tsx | 2 +- website/components/TableOfContents.tsx | 2 +- website/hooks/useConfiguredPublicClient.ts | 4 +-- website/hooks/useKaTeXRenderer.ts | 3 +- website/hooks/useMultiChainNFTs.ts | 6 ++-- website/hooks/useNFTListedStatus.ts | 4 +-- website/hooks/useTableOfContents.ts | 2 +- website/test/ContractChainSelection.test.ts | 1 + website/test/FacilitatorApproval.test.tsx | 2 +- website/test/GrowthPage.test.tsx | 30 ++++++++--------- .../test/ImageGenerator.fileUpload.test.tsx | 4 +-- website/test/Modal.test.tsx | 2 +- website/test/NFTCard.test.tsx | 2 ++ website/test/NFTList.test.tsx | 7 ++++ website/test/SupportChainModal.test.tsx | 6 ++-- website/test/WalletOptions.test.tsx | 18 +++++------ website/test/setup.ts | 32 +++++++++++++------ website/test/useGrowthApi.test.ts | 6 ++-- website/test/useSupportAction.test.ts | 26 +++++++-------- website/test/useX402ImageGeneration.test.ts | 10 +++--- website/tsconfig.json | 6 +++- website/types/katex-auto-render.d.ts | 8 +++++ website/types/vike.d.ts | 10 ++++++ website/utils/getChain.ts | 2 +- website/wagmi.config.ts | 12 +++++++ 29 files changed, 141 insertions(+), 81 deletions(-) create mode 100644 website/types/katex-auto-render.d.ts create mode 100644 website/types/vike.d.ts diff --git a/website/components/FacilitatorApproval.tsx b/website/components/FacilitatorApproval.tsx index 163f9f119..b20c64d44 100644 --- a/website/components/FacilitatorApproval.tsx +++ b/website/components/FacilitatorApproval.tsx @@ -168,7 +168,9 @@ export function FacilitatorApproval({ const [fetchError, setFetchError] = useState(null); const networks = showTestnets ? APPROVAL_NETWORKS_WITH_TESTNETS : APPROVAL_NETWORKS; - const [selectedNetwork, setSelectedNetwork] = useState(networks[0].network); + const [selectedNetwork, setSelectedNetwork] = useState<(typeof APPROVAL_NETWORKS_WITH_TESTNETS)[number]["network"]>( + networks[0].network, + ); const usdcConfig = getNetworkUSDCConfig(selectedNetwork); const targetChainId = usdcConfig ? usdcConfig.chainId : fromCAIP2(selectedNetwork); diff --git a/website/components/ImageModal.tsx b/website/components/ImageModal.tsx index 8105b7758..b82168c52 100644 --- a/website/components/ImageModal.tsx +++ b/website/components/ImageModal.tsx @@ -39,7 +39,7 @@ export function ImageModal({ image, onClose }: ImageModalProps) { {image.description &&

{image.description}

} {image.network && }
-
diff --git a/website/components/MarkdownWithLatex.tsx b/website/components/MarkdownWithLatex.tsx index 71c1a2cb2..75f9274c6 100644 --- a/website/components/MarkdownWithLatex.tsx +++ b/website/components/MarkdownWithLatex.tsx @@ -1,9 +1,9 @@ import React from "react"; -import ReactMarkdown, { type Components } from "react-markdown"; +import ReactMarkdown, { type Components, type Options } from "react-markdown"; interface MarkdownWithLatexProps { children: string; - remarkPlugins?: unknown[]; + remarkPlugins?: Options["remarkPlugins"]; components?: Partial; } @@ -20,10 +20,9 @@ export const MarkdownWithLatex: React.FC = ({ children, // Client-side LaTeX rendering after content is mounted React.useEffect(() => { if (containerRef.current) { - type RenderMathInElement = (element: Element, options?: Record) => void; import("katex/dist/contrib/auto-render") .then((module) => { - const renderMathInElement = (module as { default: RenderMathInElement }).default; + const renderMathInElement = module.default; if (containerRef.current) { renderMathInElement(containerRef.current, { delimiters: [ diff --git a/website/components/Post.tsx b/website/components/Post.tsx index bdc61fcf0..9a3859c0e 100644 --- a/website/components/Post.tsx +++ b/website/components/Post.tsx @@ -19,7 +19,7 @@ import { CommentsSection } from "./CommentsSection"; const ReactPostRenderer: React.FC<{ componentPath: string; tokenID?: number; - contentRef: React.RefObject; + contentRef: React.RefObject; onReady?: () => void; }> = ({ componentPath, tokenID, contentRef, onReady }) => { const [Component, setComponent] = React.useState(null); diff --git a/website/components/SimpleCollectButton.tsx b/website/components/SimpleCollectButton.tsx index ccb8c1cfe..4cc4461ed 100644 --- a/website/components/SimpleCollectButton.tsx +++ b/website/components/SimpleCollectButton.tsx @@ -144,7 +144,7 @@ export function SimpleCollectButton({ genImTokenId }: SimpleCollectButtonProps)