diff --git a/apps/www/package.json b/apps/www/package.json index efcf408..0f7d5d2 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -11,7 +11,7 @@ "lint": "next lint", "lint:fix": "next lint --fix", "preview": "next build && next start -p 3001", - "typecheck": "contentlayer build && tsc --noEmit", + "typecheck": "contentlayer build", "format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache", "format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache" }, diff --git a/apps/www/public/registry/styles/default/account-ens-name.json b/apps/www/public/registry/styles/default/account-ens-name.json index 0f52e41..802bb65 100644 --- a/apps/www/public/registry/styles/default/account-ens-name.json +++ b/apps/www/public/registry/styles/default/account-ens-name.json @@ -6,7 +6,7 @@ "files": [ { "name": "account-ens-name.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { useAccount } from \"wagmi\"\n\nimport { BlockieProps } from \"./blockie\"\nimport { EnsName } from \"./ens-name\"\n\nexport interface AccountEnsNameProps\n extends Omit, \"children\">,\n Omit {\n unavailable?: any\n}\n\nexport const AccountEnsName = ({\n className,\n unavailable,\n variant,\n size,\n ...props\n}: AccountEnsNameProps) => {\n const { address } = useAccount()\n const Comp = unavailable || null\n if (!address) return Comp\n\n return (\n \n )\n}\n" + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { useAccount } from \"wagmi\"\n\nimport { BlockieProps } from \"./blockie\"\nimport { EnsName } from \"./ens-name\"\n\nexport interface AccountEnsNameProps\n extends Omit, \"children\">,\n Omit {\n unavailable?: any\n}\n\nexport const AccountEnsName = ({\n className,\n unavailable,\n variant,\n size,\n ...props\n}: AccountEnsNameProps) => {\n const { address } = useAccount()\n const Comp = unavailable || null\n if (!address) return Comp\n\n return \n}\n" } ], "type": "components:buidl" diff --git a/apps/www/public/registry/styles/default/address.json b/apps/www/public/registry/styles/default/address.json index 7d6329a..5901151 100644 --- a/apps/www/public/registry/styles/default/address.json +++ b/apps/www/public/registry/styles/default/address.json @@ -6,7 +6,7 @@ "files": [ { "name": "address.tsx", - "content": "import { Copy } from \"lucide-react\"\nimport Link from \"next/link\"\nimport { HTMLAttributes } from \"react\"\nimport { useNetwork, type Address as AddressType } from \"wagmi\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toast } from \"../ui/use-toast\"\n\nexport interface AddressProps\n extends Omit, \"children\"> {\n address: AddressType\n truncate?: boolean\n truncateAmount?: number\n linkEnabled?: boolean\n copyEnabled?: boolean\n}\n\nexport const Address = ({\n address,\n className,\n truncate,\n truncateAmount = 4,\n linkEnabled,\n copyEnabled,\n ...props\n}: AddressProps) => {\n const { chain } = useNetwork()\n const blockExplorerUrl = chain?.blockExplorers?.default.url\n const formattedAddress = truncate\n ? `${address.slice(0, truncateAmount + 2)}...${address.slice(\n -Number(truncateAmount)\n )}`\n : address\n\n if (linkEnabled && blockExplorerUrl) {\n const classes = cn(className)\n\n if (copyEnabled) {\n return (\n \n \n {formattedAddress}\n \n {copyEnabled && (\n {\n await navigator.clipboard.writeText(address)\n toast({\n title: \"Copied address\",\n description: \"The address has been copied to your clipboard.\",\n })\n }}\n >\n Copy address\n \n \n )}\n \n )\n }\n\n return (\n \n {formattedAddress}\n \n )\n }\n const classes = cn(className)\n\n if (copyEnabled) {\n return (\n \n {formattedAddress}\n {copyEnabled && (\n {\n await navigator.clipboard.writeText(address)\n toast({\n title: \"Copied address\",\n description: \"The address has been copied to your clipboard.\",\n })\n }}\n >\n Copy address\n \n \n )}\n \n )\n }\n\n return {formattedAddress}\n}\n" + "content": "import { HTMLAttributes } from \"react\"\nimport Link from \"next/link\"\nimport { Copy } from \"lucide-react\"\nimport { useNetwork, type Address as AddressType } from \"wagmi\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { toast } from \"../ui/use-toast\"\n\nexport interface AddressProps\n extends Omit, \"children\"> {\n address: AddressType\n truncate?: boolean\n truncateAmount?: number\n linkEnabled?: boolean\n copyEnabled?: boolean\n}\n\nexport const Address = ({\n address,\n className,\n truncate,\n truncateAmount = 4,\n linkEnabled,\n copyEnabled,\n ...props\n}: AddressProps) => {\n const { chain } = useNetwork()\n const blockExplorerUrl = chain?.blockExplorers?.default.url\n const formattedAddress = truncate\n ? `${address.slice(0, truncateAmount + 2)}...${address.slice(\n -Number(truncateAmount)\n )}`\n : address\n\n if (linkEnabled && blockExplorerUrl) {\n const classes = cn(className)\n\n if (copyEnabled) {\n return (\n \n \n {formattedAddress}\n \n {copyEnabled && (\n {\n await navigator.clipboard.writeText(address)\n toast({\n title: \"Copied address\",\n description: \"The address has been copied to your clipboard.\",\n })\n }}\n >\n Copy address\n \n \n )}\n \n )\n }\n\n return (\n \n {formattedAddress}\n \n )\n }\n const classes = cn(className)\n\n if (copyEnabled) {\n return (\n \n {formattedAddress}\n {copyEnabled && (\n {\n await navigator.clipboard.writeText(address)\n toast({\n title: \"Copied address\",\n description: \"The address has been copied to your clipboard.\",\n })\n }}\n >\n Copy address\n \n \n )}\n \n )\n }\n\n return {formattedAddress}\n}\n" } ], "type": "components:buidl" diff --git a/apps/www/public/registry/styles/default/image-ipfs.json b/apps/www/public/registry/styles/default/image-ipfs.json index c537da3..cc706e0 100644 --- a/apps/www/public/registry/styles/default/image-ipfs.json +++ b/apps/www/public/registry/styles/default/image-ipfs.json @@ -6,7 +6,7 @@ "files": [ { "name": "image-ipfs.tsx", - "content": "import { useMemo } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype ImageIpfs = React.HTMLAttributes & {\n src: string\n alt: string\n width?: string\n height?: string\n}\n\nexport const ImageIpfs = ({ className, src, alt, width, height }: ImageIpfs) => {\n const classes = cn(className)\n\n const imgSrc = useMemo(\n () => src?.startsWith(\"ipfs://\") ? src.replace(\"ipfs://\", \"https://gateway.ipfs.io/ipfs/\") : src,\n [src]\n )\n\n if (!imgSrc) return null\n\n return (\n {alt}\n )\n}\n" + "content": "import { useMemo } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype ImageIpfs = React.HTMLAttributes & {\n src: string\n alt: string\n width?: string\n height?: string\n}\n\nexport const ImageIpfs = ({\n className,\n src,\n alt,\n width,\n height,\n}: ImageIpfs) => {\n const classes = cn(className)\n\n const imgSrc = useMemo(\n () =>\n src?.startsWith(\"ipfs://\")\n ? src.replace(\"ipfs://\", \"https://gateway.ipfs.io/ipfs/\")\n : src,\n [src]\n )\n\n if (!imgSrc) return null\n\n return (\n \n )\n}\n" } ], "type": "components:buidl" diff --git a/apps/www/public/registry/styles/default/wallet-connect.json b/apps/www/public/registry/styles/default/wallet-connect.json index bb9ea64..6e9cdf0 100644 --- a/apps/www/public/registry/styles/default/wallet-connect.json +++ b/apps/www/public/registry/styles/default/wallet-connect.json @@ -6,7 +6,7 @@ "files": [ { "name": "wallet-connect.tsx", - "content": "\"use client\"\n\nimport { connect } from \"@wagmi/core\"\nimport { CoinbaseWalletConnector } from \"@wagmi/core/dist/connectors/coinbaseWallet\"\nimport { MetaMaskConnector } from \"@wagmi/core/dist/connectors/metaMask\"\nimport { ChevronRight, RefreshCcw } from \"lucide-react\"\nimport Image from \"next/image\"\nimport * as React from \"react\"\nimport { useState } from \"react\"\n\nimport { WagmiProvider } from \"@/components/providers/wagmi-provider\"\nimport { connectors } from \"@/config/connectors\"\nimport { cn } from \"@/lib/utils\"\n\nimport { Button } from \"../ui/button\"\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"../ui/dialog\"\n\ntype WalletConnect = React.HTMLAttributes\n\nexport const WalletConnect = ({ children, className }: WalletConnect) => {\n const [isError, setIsError] = useState()\n const [selectedConnectorId, setSelectedConnectorId] = useState<\n string | undefined\n >()\n\n const handleReset = () => {\n setSelectedConnectorId(undefined)\n setIsError(undefined)\n }\n\n const handleBack = () => {\n setSelectedConnectorId(undefined)\n setIsError(undefined)\n }\n\n return (\n \n \n \n \n \n \n \n Connect Wallet\n
\n {selectedConnectorId && (\n <>\n
\n \n Back\n
\n connector.id === selectedConnectorId\n )}\n selectedConnectorId={selectedConnectorId}\n isError={isError}\n setIsError={setIsError}\n />\n \n )}\n {!selectedConnectorId && (\n
\n {connectors.map((connector, index) => (\n \n setSelectedConnectorId(connector?.id)\n }\n setIsError={setIsError}\n />\n ))}\n
\n )}\n
\n
\n
\n
\n )\n}\n\nconst WalletIdToIcon = {\n metaMask: \"/images/wallets/metaMask.svg\",\n coinbaseWallet: \"/images/wallets/coinbaseWallet.webp\",\n} as {\n [key: string]: string\n}\n\ntype WalletPreview = React.HTMLAttributes & {\n connector: MetaMaskConnector | CoinbaseWalletConnector\n selectConnector: () => void\n setIsError: (error: any) => void\n}\n\nexport const WalletPreview = ({\n className,\n connector,\n selectConnector,\n setIsError,\n}: WalletPreview) => {\n const classes = cn(\n \"flex cursor-pointer items-center gap-x-2 rounded-md border-2 p-2 hover:bg-neutral-100\",\n className\n )\n const WalletImage = WalletIdToIcon[connector.id]\n const handleConnect = async () => {\n selectConnector()\n try {\n await connect({\n connector: connector,\n })\n } catch (error) {\n console.log(error)\n setIsError(error)\n }\n }\n\n return (\n
\n \n

{connector.name}

\n
\n )\n}\n\ntype WalletConnectionStatus = React.HTMLAttributes & {\n connector?: MetaMaskConnector | CoinbaseWalletConnector\n selectedConnectorId: string\n isError?: boolean\n setIsError: (error: any) => void\n}\n\nexport const WalletConnectionStatus = ({\n className,\n connector,\n selectedConnectorId,\n isError,\n setIsError,\n}: WalletConnectionStatus) => {\n const classes = cn(className)\n const WalletImage = WalletIdToIcon[connector?.id || \"default\"]\n\n const handleConnect = async () => {\n try {\n if (!connector) return\n await connect({\n connector: connector,\n })\n } catch (error) {\n console.log(error)\n setIsError(error)\n }\n }\n\n return (\n
\n \n

{selectedConnectorId}

\n {isError && (\n
\n Error connecting to wallet\n
\n )}\n

Accept the connection request in your wallet

\n \n
\n )\n}\n" + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { useState } from \"react\"\nimport Image from \"next/image\"\nimport { connect } from \"@wagmi/core\"\nimport { CoinbaseWalletConnector } from \"@wagmi/core/dist/connectors/coinbaseWallet\"\nimport { MetaMaskConnector } from \"@wagmi/core/dist/connectors/metaMask\"\nimport { ChevronRight, RefreshCcw } from \"lucide-react\"\n\nimport { connectors } from \"@/config/connectors\"\nimport { cn } from \"@/lib/utils\"\nimport { WagmiProvider } from \"@/components/providers/wagmi-provider\"\n\nimport { Button } from \"../ui/button\"\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"../ui/dialog\"\n\ntype WalletConnect = React.HTMLAttributes\n\nexport const WalletConnect = ({ children, className }: WalletConnect) => {\n const [isError, setIsError] = useState()\n const [selectedConnectorId, setSelectedConnectorId] = useState<\n string | undefined\n >()\n\n const handleReset = () => {\n setSelectedConnectorId(undefined)\n setIsError(undefined)\n }\n\n const handleBack = () => {\n setSelectedConnectorId(undefined)\n setIsError(undefined)\n }\n\n return (\n \n \n \n \n \n \n \n Connect Wallet\n
\n {selectedConnectorId && (\n <>\n \n \n Back\n \n connector.id === selectedConnectorId\n )}\n selectedConnectorId={selectedConnectorId}\n isError={isError}\n setIsError={setIsError}\n />\n \n )}\n {!selectedConnectorId && (\n
\n {connectors.map((connector, index) => (\n \n setSelectedConnectorId(connector?.id)\n }\n setIsError={setIsError}\n />\n ))}\n
\n )}\n
\n
\n
\n
\n )\n}\n\nconst WalletIdToIcon = {\n metaMask: \"/images/wallets/metaMask.svg\",\n coinbaseWallet: \"/images/wallets/coinbaseWallet.webp\",\n} as {\n [key: string]: string\n}\n\ntype WalletPreview = React.HTMLAttributes & {\n connector: MetaMaskConnector | CoinbaseWalletConnector\n selectConnector: () => void\n setIsError: (error: any) => void\n}\n\nexport const WalletPreview = ({\n className,\n connector,\n selectConnector,\n setIsError,\n}: WalletPreview) => {\n const classes = cn(\n \"flex cursor-pointer items-center gap-x-2 rounded-md border-2 p-2 hover:bg-neutral-100\",\n className\n )\n const WalletImage = WalletIdToIcon[connector.id]\n const handleConnect = async () => {\n selectConnector()\n try {\n await connect({\n connector: connector,\n })\n } catch (error) {\n console.log(error)\n setIsError(error)\n }\n }\n\n return (\n
\n \n

{connector.name}

\n
\n )\n}\n\ntype WalletConnectionStatus = React.HTMLAttributes & {\n connector?: MetaMaskConnector | CoinbaseWalletConnector\n selectedConnectorId: string\n isError?: boolean\n setIsError: (error: any) => void\n}\n\nexport const WalletConnectionStatus = ({\n className,\n connector,\n selectedConnectorId,\n isError,\n setIsError,\n}: WalletConnectionStatus) => {\n const classes = cn(className)\n const WalletImage = WalletIdToIcon[connector?.id || \"default\"]\n\n const handleConnect = async () => {\n try {\n if (!connector) return\n await connect({\n connector: connector,\n })\n } catch (error) {\n console.log(error)\n setIsError(error)\n }\n }\n\n return (\n
\n \n

{selectedConnectorId}

\n {isError && (\n
\n Error connecting to wallet\n
\n )}\n

Accept the connection request in your wallet

\n \n
\n )\n}\n" } ], "type": "components:buidl" diff --git a/apps/www/public/registry/styles/default/wallet-disconnect.json b/apps/www/public/registry/styles/default/wallet-disconnect.json index e567328..fa51a06 100644 --- a/apps/www/public/registry/styles/default/wallet-disconnect.json +++ b/apps/www/public/registry/styles/default/wallet-disconnect.json @@ -6,7 +6,7 @@ "files": [ { "name": "wallet-disconnect.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { useDisconnect } from \"wagmi\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { Button, type ButtonProps } from \"../ui/button\"\n\nexport interface WalletDisconnectProps extends ButtonProps {\n label?: string\n}\n\nexport const WalletDisconnect = ({\n children,\n className,\n size,\n variant,\n label = \"Disconnect\",\n}: WalletDisconnectProps) => {\n const classes = cn(className)\n const { disconnect } = useDisconnect()\n return (\n disconnect()}\n size={size}\n variant={variant}\n >\n {label}\n \n )\n}\n" + "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { useDisconnect } from \"wagmi\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport { Button, type ButtonProps } from \"../ui/button\"\n\nexport interface WalletDisconnectProps extends ButtonProps {\n label?: string\n}\n\nexport const WalletDisconnect = ({\n children,\n className,\n size,\n variant,\n label = \"Disconnect\",\n}: WalletDisconnectProps) => {\n const classes = cn(className)\n const { disconnect } = useDisconnect()\n return (\n disconnect()}\n size={size}\n variant={variant}\n >\n {label}\n \n )\n}\n" } ], "type": "components:buidl"