Skip to content

Commit

Permalink
chore: update typecheck command
Browse files Browse the repository at this point in the history
  • Loading branch information
marthendalnunes committed Nov 27, 2023
1 parent df62763 commit 2fd9b80
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<React.HTMLAttributes<HTMLElement>, \"children\">,\n Omit<BlockieProps, \"address\"> {\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 <EnsName\n address={address}\n className={className}\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<React.HTMLAttributes<HTMLElement>, \"children\">,\n Omit<BlockieProps, \"address\"> {\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 <EnsName address={address} className={className} />\n}\n"
}
],
"type": "components:buidl"
Expand Down
2 changes: 1 addition & 1 deletion apps/www/public/registry/styles/default/address.json
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLAttributes<HTMLElement>, \"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 <span className=\"flex items-center\">\n <Link\n className={classes}\n href={`${blockExplorerUrl}/address/${address}`}\n {...props}\n >\n {formattedAddress}\n </Link>\n {copyEnabled && (\n <button\n className=\"ml-2 opacity-70 transition-opacity hover:opacity-100\"\n onClick={async () => {\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 <span className=\"sr-only\">Copy address</span>\n <Copy size={12} />\n </button>\n )}\n </span>\n )\n }\n\n return (\n <Link\n className={classes}\n href={`${blockExplorerUrl}/address/${address}`}\n {...props}\n >\n {formattedAddress}\n </Link>\n )\n }\n const classes = cn(className)\n\n if (copyEnabled) {\n return (\n <span className=\"\">\n <span className={classes}>{formattedAddress}</span>\n {copyEnabled && (\n <button\n className=\"ml-2 opacity-70 transition-opacity hover:opacity-100\"\n onClick={async () => {\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 <span className=\"sr-only\">Copy address</span>\n <Copy size={12} />\n </button>\n )}\n </span>\n )\n }\n\n return <span className={classes}>{formattedAddress}</span>\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<HTMLAttributes<HTMLElement>, \"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 <span className=\"flex items-center\">\n <Link\n className={classes}\n href={`${blockExplorerUrl}/address/${address}`}\n {...props}\n >\n {formattedAddress}\n </Link>\n {copyEnabled && (\n <button\n className=\"ml-2 opacity-70 transition-opacity hover:opacity-100\"\n onClick={async () => {\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 <span className=\"sr-only\">Copy address</span>\n <Copy size={12} />\n </button>\n )}\n </span>\n )\n }\n\n return (\n <Link\n className={classes}\n href={`${blockExplorerUrl}/address/${address}`}\n {...props}\n >\n {formattedAddress}\n </Link>\n )\n }\n const classes = cn(className)\n\n if (copyEnabled) {\n return (\n <span className=\"\">\n <span className={classes}>{formattedAddress}</span>\n {copyEnabled && (\n <button\n className=\"ml-2 opacity-70 transition-opacity hover:opacity-100\"\n onClick={async () => {\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 <span className=\"sr-only\">Copy address</span>\n <Copy size={12} />\n </button>\n )}\n </span>\n )\n }\n\n return <span className={classes}>{formattedAddress}</span>\n}\n"
}
],
"type": "components:buidl"
Expand Down
2 changes: 1 addition & 1 deletion apps/www/public/registry/styles/default/image-ipfs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLElement> & {\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 <img src={imgSrc} width={width} height={height} alt={alt} className={classes} />\n )\n}\n"
"content": "import { useMemo } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype ImageIpfs = React.HTMLAttributes<HTMLElement> & {\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 <img\n src={imgSrc}\n width={width}\n height={height}\n alt={alt}\n className={classes}\n />\n )\n}\n"
}
],
"type": "components:buidl"
Expand Down
Loading

0 comments on commit 2fd9b80

Please sign in to comment.