diff --git a/README.md b/README.md index afd00aa..2ce0adf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# TurboETH BUIDL +# TurboETH ⚡️ BUIDL -Handcrafted Web3 components that you can copy and paste into your WAGMI apps. Free. Open Source. **Use this to build your own component library**. +Collection of essential components for any modern Web3 applications. Save time and BUIDL faster. Free. Open Source. **Use this to build your own component library**. ## Documentation diff --git a/apps/www/__registry__/.autogenerated b/apps/www/__registry__/.autogenerated deleted file mode 100644 index 0055c2a..0000000 --- a/apps/www/__registry__/.autogenerated +++ /dev/null @@ -1 +0,0 @@ -// The content of this directory is autogenerated by the registry server. diff --git a/apps/www/__registry__/README.md b/apps/www/__registry__/README.md index 5621cea..410f2aa 100644 --- a/apps/www/__registry__/README.md +++ b/apps/www/__registry__/README.md @@ -1 +1 @@ -> Files inside this directory is autogenerated by `./scripts/build-registry.ts`. **Do not edit them manually.** - shadcn +Files are auto-generated. Do not edit! \ No newline at end of file diff --git a/apps/www/__registry__/index.tsx b/apps/www/__registry__/index.tsx index 8bc03fe..99b620c 100644 --- a/apps/www/__registry__/index.tsx +++ b/apps/www/__registry__/index.tsx @@ -96,13 +96,6 @@ export const Index: Record = { component: React.lazy(() => import("@/registry/default/buidl/erc20/erc20-select-and-amount")), files: ["registry/default/buidl/erc20/erc20-select-and-amount.tsx"], }, - "accordion": { - name: "accordion", - type: "components:ui", - registryDependencies: undefined, - component: React.lazy(() => import("@/registry/default/ui/accordion")), - files: ["registry/default/ui/accordion.tsx"], - }, "address-demo": { name: "address-demo", type: "components:example", @@ -222,12 +215,5 @@ export const Index: Record = { component: React.lazy(() => import("@/registry/default/example/erc20-select-and-amount-demo")), files: ["registry/default/example/erc20-select-and-amount-demo.tsx"], }, - "accordion-demo": { - name: "accordion-demo", - type: "components:example", - registryDependencies: ["accordion"], - component: React.lazy(() => import("@/registry/default/example/accordion-demo")), - files: ["registry/default/example/accordion-demo.tsx"], - }, }, } diff --git a/apps/www/app/examples/authentication/page.tsx b/apps/www/app/examples/authentication/page.tsx index 969175a..46da831 100644 --- a/apps/www/app/examples/authentication/page.tsx +++ b/apps/www/app/examples/authentication/page.tsx @@ -3,8 +3,14 @@ import Image from "next/image" import Link from "next/link" import { cn } from "@/lib/utils" -import { buttonVariants } from "@/registry/default/ui/button" -import { UserAuthForm } from "@/app/examples/authentication/components/user-auth-form" +import { AccountAddress } from "@/registry/default/buidl/account-address" +import { AccountBlockie } from "@/registry/default/buidl/account-blockie" +import { Address } from "@/registry/default/buidl/address" +import { IsWalletConnected } from "@/registry/default/buidl/is-wallet-connected" +import { IsWalletDisconnected } from "@/registry/default/buidl/is-wallet-disconnected" +import { WalletConnect } from "@/registry/default/buidl/wallet-connect" +import { WalletDisconnect } from "@/registry/default/buidl/wallet-disconnect" +import { Button, buttonVariants } from "@/registry/default/ui/button" export const metadata: Metadata = { title: "Authentication", @@ -14,21 +20,8 @@ export const metadata: Metadata = { export default function AuthenticationPage() { return ( <> -
- Authentication - Authentication +
+ View this page on a larger screen to see the full example.
- Acme Inc + Degen Inc

- “This library has saved me countless hours of work and - helped me deliver stunning designs to my clients faster than - ever before.” + “I always degenerate to chocolate and coffee.”

-
Sofia Davis
+
Mandy Ingber
-
-

- Create an account -

-

- Enter your email below to create your account + +

+

+ Connect Wallet to Continue +

+

+ Enter your email below to create your account +

+
+ +

+ By clicking continue, you agree to our{" "} + + Terms of Service + {" "} + and{" "} + + Privacy Policy + + .

-
- -

- By clicking continue, you agree to our{" "} - - Terms of Service - {" "} - and{" "} - - Privacy Policy - - . -

+ + +
+ + + +
+
diff --git a/apps/www/app/examples/layout.tsx b/apps/www/app/examples/layout.tsx index 6ee61c9..976ab46 100644 --- a/apps/www/app/examples/layout.tsx +++ b/apps/www/app/examples/layout.tsx @@ -26,24 +26,21 @@ export default function ExamplesLayout({ children }: ExamplesLayoutProps) { <>
- - 🎉 {" "} - Style, a new CLI and more. - - Introducing Style, a new CLI and more. - - - + + ⚡️ {" "} + Build Web3 in Turbo Mode. + Build Web3 in Turbo Mode + + Check out some examples. Examples - Dashboard, cards, authentication. Some examples built using the - components. Use this as a guide to build your own. + More examples coming soon!
⚡️ {" "} @@ -31,8 +31,7 @@ export default function IndexPage() { A Flexible Web3 Component Library - Handcrafted Web3 components that you can copy and paste into your - WAGMI apps.{" "} + Collection of essential components for any modern Web3 applications.{" "} Save time and BUIDL faster.
diff --git a/apps/www/components/examples-nav.tsx b/apps/www/components/examples-nav.tsx index a1870f8..4ce51d4 100644 --- a/apps/www/components/examples-nav.tsx +++ b/apps/www/components/examples-nav.tsx @@ -11,7 +11,7 @@ const examples = [ { name: "Authentication", href: "/examples/authentication", - code: "https://github.com/shadcn/ui/tree/main/apps/www/app/examples/authentication", + code: "https://github.com/turbo-eth/buidl/tree/main/apps/www/app/examples/authentication", }, ] diff --git a/apps/www/components/main-nav.tsx b/apps/www/components/main-nav.tsx index 5dbf52f..f6b0cb1 100644 --- a/apps/www/components/main-nav.tsx +++ b/apps/www/components/main-nav.tsx @@ -31,7 +31,7 @@ export function MainNav() { Documentation Components - {/* - Themes - - - Examples - */} - shadcn + District Labs . The source code is available on{" "} -Update the import paths to match your project setup. + Update `tailwind.config.js` diff --git a/apps/www/content/docs/components/account-address.mdx b/apps/www/content/docs/components/account-address.mdx index fb5bd7c..d931545 100644 --- a/apps/www/content/docs/components/account-address.mdx +++ b/apps/www/content/docs/components/account-address.mdx @@ -40,8 +40,6 @@ wagmi: -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/account-blockie.mdx b/apps/www/content/docs/components/account-blockie.mdx index 26acce9..ea278d6 100644 --- a/apps/www/content/docs/components/account-blockie.mdx +++ b/apps/www/content/docs/components/account-blockie.mdx @@ -2,9 +2,7 @@ title: Account Blockie description: Display connected account blockie identicon. component: true -radix: - link: https://www.radix-ui.com/docs/primitives/components/accordion - api: https://www.radix-ui.com/docs/primitives/components/accordion#api-reference + --- -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/account-ens-name.mdx b/apps/www/content/docs/components/account-ens-name.mdx index 3be91a6..1853c32 100644 --- a/apps/www/content/docs/components/account-ens-name.mdx +++ b/apps/www/content/docs/components/account-ens-name.mdx @@ -40,8 +40,6 @@ radix: -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/address.mdx b/apps/www/content/docs/components/address.mdx index e0b058d..ae31432 100644 --- a/apps/www/content/docs/components/address.mdx +++ b/apps/www/content/docs/components/address.mdx @@ -40,8 +40,6 @@ wagmi: -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/blockie.mdx b/apps/www/content/docs/components/blockie.mdx index e9012f0..59abb20 100644 --- a/apps/www/content/docs/components/blockie.mdx +++ b/apps/www/content/docs/components/blockie.mdx @@ -2,9 +2,6 @@ title: Blockie description: Display an account blockie identicon. component: true -radix: - link: https://www.radix-ui.com/docs/primitives/components/accordion - api: https://www.radix-ui.com/docs/primitives/components/accordion#api-reference --- -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/ens-image.mdx b/apps/www/content/docs/components/ens-image.mdx new file mode 100644 index 0000000..b6a98d1 --- /dev/null +++ b/apps/www/content/docs/components/ens-image.mdx @@ -0,0 +1,57 @@ +--- +title: ENS Name +description: Display an account ENS domain name. +component: true +radix: + link: https://wagmi.sh/react/hooks/useEnsAvatar +--- + + + +## Installation + + + + + Manual + + CLI (Coming Soon) + + + + + + + +Coming soon... + + + + + + + + + +Copy and paste the following code into your project. + + + + + + + + + +## Usage + +```tsx +import { EnsName } from "@/components/buidl/ens-name" +``` + +```tsx + +``` diff --git a/apps/www/content/docs/components/ens-name.mdx b/apps/www/content/docs/components/ens-name.mdx index 82cc2fa..b6a98d1 100644 --- a/apps/www/content/docs/components/ens-name.mdx +++ b/apps/www/content/docs/components/ens-name.mdx @@ -40,8 +40,6 @@ radix: -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/ens-symbol.mdx b/apps/www/content/docs/components/ens-symbol.mdx index d95440b..87598fb 100644 --- a/apps/www/content/docs/components/ens-symbol.mdx +++ b/apps/www/content/docs/components/ens-symbol.mdx @@ -40,8 +40,6 @@ radix: -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/erc20-balance.mdx b/apps/www/content/docs/components/erc20-balance.mdx index 334ab7d..660b62e 100644 --- a/apps/www/content/docs/components/erc20-balance.mdx +++ b/apps/www/content/docs/components/erc20-balance.mdx @@ -38,8 +38,6 @@ component: true -Update the import paths to match your project setup. - @@ -53,8 +51,8 @@ import { Erc20Balance } from "@/components/buidl/erc20-balance" ``` ```tsx - ``` diff --git a/apps/www/content/docs/components/erc20-image.mdx b/apps/www/content/docs/components/erc20-image.mdx index b350035..1f512e4 100644 --- a/apps/www/content/docs/components/erc20-image.mdx +++ b/apps/www/content/docs/components/erc20-image.mdx @@ -38,8 +38,6 @@ component: true -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/erc20-name.mdx b/apps/www/content/docs/components/erc20-name.mdx index 5edbdf2..d2da2fc 100644 --- a/apps/www/content/docs/components/erc20-name.mdx +++ b/apps/www/content/docs/components/erc20-name.mdx @@ -38,8 +38,6 @@ component: true -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/erc20-select-and-amount.mdx b/apps/www/content/docs/components/erc20-select-and-amount.mdx index 67ba22a..4620842 100644 --- a/apps/www/content/docs/components/erc20-select-and-amount.mdx +++ b/apps/www/content/docs/components/erc20-select-and-amount.mdx @@ -38,8 +38,6 @@ component: true -Update the import paths to match your project setup. - @@ -49,9 +47,9 @@ component: true ## Usage ```tsx -import { Erc20Symbol } from "@/components/buidl/erc20-select-and-amount" +import { Erc20SelectAndAmount } from "@/components/buidl/erc20-select-and-amount" ``` ```tsx - + ``` diff --git a/apps/www/content/docs/components/erc20-select.mdx b/apps/www/content/docs/components/erc20-select.mdx index 8a34107..2eb0fd5 100644 --- a/apps/www/content/docs/components/erc20-select.mdx +++ b/apps/www/content/docs/components/erc20-select.mdx @@ -38,8 +38,6 @@ component: true -Update the import paths to match your project setup. - @@ -49,9 +47,9 @@ component: true ## Usage ```tsx -import { Erc20Symbol } from "@/components/buidl/erc20-select" +import { Erc20Select } from "@/components/buidl/erc20-select" ``` ```tsx - + ``` diff --git a/apps/www/content/docs/components/erc20-symbol.mdx b/apps/www/content/docs/components/erc20-symbol.mdx index ed53222..7eefe42 100644 --- a/apps/www/content/docs/components/erc20-symbol.mdx +++ b/apps/www/content/docs/components/erc20-symbol.mdx @@ -38,8 +38,6 @@ component: true -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/network-manage.mdx b/apps/www/content/docs/components/network-manage.mdx index 7b10352..00b2ca2 100644 --- a/apps/www/content/docs/components/network-manage.mdx +++ b/apps/www/content/docs/components/network-manage.mdx @@ -40,8 +40,6 @@ radix: -Update the import paths to match your project setup. - diff --git a/apps/www/content/docs/components/wallet-connect.mdx b/apps/www/content/docs/components/wallet-connect.mdx index fe4551d..0e4cd32 100644 --- a/apps/www/content/docs/components/wallet-connect.mdx +++ b/apps/www/content/docs/components/wallet-connect.mdx @@ -40,8 +40,6 @@ radix: -Update the import paths to match your project setup. - @@ -51,9 +49,9 @@ radix: ## Usage ```tsx -import { EnsName } from "@/components/buidl/wallet-connect" +import { WalletConnect } from "@/components/buidl/wallet-connect" ``` ```tsx - + ``` diff --git a/apps/www/content/docs/components/wallet-manage.mdx b/apps/www/content/docs/components/wallet-manage.mdx index 0a90bcf..7134419 100644 --- a/apps/www/content/docs/components/wallet-manage.mdx +++ b/apps/www/content/docs/components/wallet-manage.mdx @@ -40,8 +40,6 @@ radix: -Update the import paths to match your project setup. - diff --git a/apps/www/lib/utils.ts b/apps/www/lib/utils.ts index 67729bc..cb0b0e4 100644 --- a/apps/www/lib/utils.ts +++ b/apps/www/lib/utils.ts @@ -30,4 +30,4 @@ export function trimFormattedBalance( const trimmedDecimal = decimal.slice(0, decimals) return `${integer}.${trimmedDecimal}` -} \ No newline at end of file +} diff --git a/apps/www/next.config.mjs b/apps/www/next.config.mjs index ab2602e..46174e9 100644 --- a/apps/www/next.config.mjs +++ b/apps/www/next.config.mjs @@ -24,12 +24,12 @@ const nextConfig = { return [ { source: "/components", - destination: "/docs/components/accordion", + destination: "/docs/components/wallet-connect", permanent: true, }, { source: "/docs/components", - destination: "/docs/components/accordion", + destination: "/docs/components/wallet-connect", permanent: true, }, { diff --git a/apps/www/public/android-chrome-192x192.png b/apps/www/public/android-chrome-192x192.png index 12cf161..cce1581 100644 Binary files a/apps/www/public/android-chrome-192x192.png and b/apps/www/public/android-chrome-192x192.png differ diff --git a/apps/www/public/android-chrome-512x512.png b/apps/www/public/android-chrome-512x512.png index 5bafcab..e7efe7d 100644 Binary files a/apps/www/public/android-chrome-512x512.png and b/apps/www/public/android-chrome-512x512.png differ diff --git a/apps/www/public/apple-touch-icon.png b/apps/www/public/apple-touch-icon.png index 1027935..9bd8050 100644 Binary files a/apps/www/public/apple-touch-icon.png and b/apps/www/public/apple-touch-icon.png differ diff --git a/apps/www/public/examples/authentication-dark.png b/apps/www/public/examples/authentication-dark.png deleted file mode 100644 index 466a087..0000000 Binary files a/apps/www/public/examples/authentication-dark.png and /dev/null differ diff --git a/apps/www/public/examples/authentication-light.png b/apps/www/public/examples/authentication-light.png deleted file mode 100644 index e38a9e4..0000000 Binary files a/apps/www/public/examples/authentication-light.png and /dev/null differ diff --git a/apps/www/public/examples/cards-dark.png b/apps/www/public/examples/cards-dark.png deleted file mode 100644 index 47f183e..0000000 Binary files a/apps/www/public/examples/cards-dark.png and /dev/null differ diff --git a/apps/www/public/examples/cards-light.png b/apps/www/public/examples/cards-light.png deleted file mode 100644 index 5dea379..0000000 Binary files a/apps/www/public/examples/cards-light.png and /dev/null differ diff --git a/apps/www/public/examples/dashboard-dark.png b/apps/www/public/examples/dashboard-dark.png deleted file mode 100644 index aeb6b70..0000000 Binary files a/apps/www/public/examples/dashboard-dark.png and /dev/null differ diff --git a/apps/www/public/examples/dashboard-light.png b/apps/www/public/examples/dashboard-light.png deleted file mode 100644 index 9631b98..0000000 Binary files a/apps/www/public/examples/dashboard-light.png and /dev/null differ diff --git a/apps/www/public/examples/forms-dark.png b/apps/www/public/examples/forms-dark.png deleted file mode 100644 index 52ae1fc..0000000 Binary files a/apps/www/public/examples/forms-dark.png and /dev/null differ diff --git a/apps/www/public/examples/forms-light.png b/apps/www/public/examples/forms-light.png deleted file mode 100644 index 15d7612..0000000 Binary files a/apps/www/public/examples/forms-light.png and /dev/null differ diff --git a/apps/www/public/examples/music-dark.png b/apps/www/public/examples/music-dark.png deleted file mode 100644 index 6cd7073..0000000 Binary files a/apps/www/public/examples/music-dark.png and /dev/null differ diff --git a/apps/www/public/examples/music-light.png b/apps/www/public/examples/music-light.png deleted file mode 100644 index 081c043..0000000 Binary files a/apps/www/public/examples/music-light.png and /dev/null differ diff --git a/apps/www/public/examples/playground-dark.png b/apps/www/public/examples/playground-dark.png deleted file mode 100644 index bc22162..0000000 Binary files a/apps/www/public/examples/playground-dark.png and /dev/null differ diff --git a/apps/www/public/examples/playground-light.png b/apps/www/public/examples/playground-light.png deleted file mode 100644 index 4e3904b..0000000 Binary files a/apps/www/public/examples/playground-light.png and /dev/null differ diff --git a/apps/www/public/examples/tasks-dark.png b/apps/www/public/examples/tasks-dark.png deleted file mode 100644 index 697cad0..0000000 Binary files a/apps/www/public/examples/tasks-dark.png and /dev/null differ diff --git a/apps/www/public/examples/tasks-light.png b/apps/www/public/examples/tasks-light.png deleted file mode 100644 index 49069ed..0000000 Binary files a/apps/www/public/examples/tasks-light.png and /dev/null differ diff --git a/apps/www/public/favicon-16x16.png b/apps/www/public/favicon-16x16.png index 0840dbf..dca243d 100644 Binary files a/apps/www/public/favicon-16x16.png and b/apps/www/public/favicon-16x16.png differ diff --git a/apps/www/public/favicon-32x32.png b/apps/www/public/favicon-32x32.png index aeb876e..4113d83 100644 Binary files a/apps/www/public/favicon-32x32.png and b/apps/www/public/favicon-32x32.png differ diff --git a/apps/www/public/favicon.ico b/apps/www/public/favicon.ico index 2f96628..f9d72a3 100644 Binary files a/apps/www/public/favicon.ico and b/apps/www/public/favicon.ico differ diff --git a/apps/www/public/images/logo-light.png b/apps/www/public/images/logo-light.png new file mode 100644 index 0000000..fb6a35a Binary files /dev/null and b/apps/www/public/images/logo-light.png differ diff --git a/apps/www/public/images/style-with-theming.jpg b/apps/www/public/images/style-with-theming.jpg deleted file mode 100644 index 2ebc67b..0000000 Binary files a/apps/www/public/images/style-with-theming.jpg and /dev/null differ diff --git a/apps/www/public/images/style.jpg b/apps/www/public/images/style.jpg deleted file mode 100644 index bfc0dae..0000000 Binary files a/apps/www/public/images/style.jpg and /dev/null differ diff --git a/apps/www/public/mstile-150x150.png b/apps/www/public/mstile-150x150.png new file mode 100644 index 0000000..675c765 Binary files /dev/null and b/apps/www/public/mstile-150x150.png differ diff --git a/apps/www/public/og.png b/apps/www/public/og.png index 9f8992a..7357755 100644 Binary files a/apps/www/public/og.png and b/apps/www/public/og.png differ diff --git a/apps/www/public/registry/index.json b/apps/www/public/registry/index.json index 204734c..0637a08 100644 --- a/apps/www/public/registry/index.json +++ b/apps/www/public/registry/index.json @@ -1,12 +1 @@ -[ - { - "name": "accordion", - "dependencies": [ - "wagmi" - ], - "files": [ - "ui/accordion.tsx" - ], - "type": "components:ui" - } -] \ No newline at end of file +[] \ No newline at end of file diff --git a/apps/www/registry/default/buidl/account-address.tsx b/apps/www/registry/default/buidl/account-address.tsx index 44ed785..09aee83 100644 --- a/apps/www/registry/default/buidl/account-address.tsx +++ b/apps/www/registry/default/buidl/account-address.tsx @@ -1,3 +1,5 @@ +"use client" + import { HTMLAttributes } from "react" import { useAccount } from "wagmi" diff --git a/apps/www/registry/default/buidl/account-balance.tsx b/apps/www/registry/default/buidl/account-balance.tsx index e39d64c..f7ec2bd 100644 --- a/apps/www/registry/default/buidl/account-balance.tsx +++ b/apps/www/registry/default/buidl/account-balance.tsx @@ -1,3 +1,5 @@ +"use client" + import { HTMLAttributes } from "react" import { useAccount, useBalance } from "wagmi" diff --git a/apps/www/registry/default/buidl/account-blockie.tsx b/apps/www/registry/default/buidl/account-blockie.tsx index e4e0755..0ef3967 100644 --- a/apps/www/registry/default/buidl/account-blockie.tsx +++ b/apps/www/registry/default/buidl/account-blockie.tsx @@ -1,3 +1,5 @@ +"use client" + import * as React from "react" import { useAccount } from "wagmi" diff --git a/apps/www/registry/default/buidl/account-ens-avatar.tsx b/apps/www/registry/default/buidl/account-ens-avatar.tsx index 7acf2d1..1799373 100644 --- a/apps/www/registry/default/buidl/account-ens-avatar.tsx +++ b/apps/www/registry/default/buidl/account-ens-avatar.tsx @@ -1,3 +1,5 @@ +"use client" + import * as React from "react" import { useAccount } from "wagmi" diff --git a/apps/www/registry/default/buidl/account-ens-name.tsx b/apps/www/registry/default/buidl/account-ens-name.tsx index 755a7bb..de1a0ce 100644 --- a/apps/www/registry/default/buidl/account-ens-name.tsx +++ b/apps/www/registry/default/buidl/account-ens-name.tsx @@ -1,31 +1,31 @@ +"use client" + import * as React from "react" import { useAccount } from "wagmi" import { BlockieProps } from "./blockie" -import { EnsAvatar } from "./ens-avatar" +import { EnsName } from "./ens-name" -export interface AccountEnNameProps +export interface AccountEnsNameProps extends Omit, "children">, Omit { unavailable?: any } -export const AccountEnName = ({ +export const AccountEnsName = ({ className, unavailable, variant, size, ...props -}: AccountEnNameProps) => { +}: AccountEnsNameProps) => { const { address } = useAccount() const Comp = unavailable || null if (!address) return Comp return ( - ) diff --git a/apps/www/registry/default/buidl/account-nonce.tsx b/apps/www/registry/default/buidl/account-nonce.tsx new file mode 100644 index 0000000..0e17a54 --- /dev/null +++ b/apps/www/registry/default/buidl/account-nonce.tsx @@ -0,0 +1,25 @@ +import { HTMLAttributes } from "react" +import { useAccount, usePublicClient, useQuery } from "wagmi" + +type AccountNonceProps = Omit, "children"> + +export const AccountNonce = ({ className, ...props }: AccountNonceProps) => { + const publicClient = usePublicClient() + const { address } = useAccount() + + const { data: nonce } = useQuery(["wallet-nonce", address, publicClient], { + queryFn: async () => { + if (!publicClient || !address) return + return await publicClient.getTransactionCount({ + address, + }) + }, + enabled: !!address && !!publicClient, + }) + + return ( + + {nonce} + + ) +} diff --git a/apps/www/registry/default/buidl/erc20/erc20-image.tsx b/apps/www/registry/default/buidl/erc20/erc20-image.tsx index ebb73b3..33905dc 100644 --- a/apps/www/registry/default/buidl/erc20/erc20-image.tsx +++ b/apps/www/registry/default/buidl/erc20/erc20-image.tsx @@ -32,8 +32,11 @@ export const Erc20Image = ({ } if (token) { let tokenImage = token.logoURI - if(tokenImage?.startsWith("ipfs://")) { - tokenImage= tokenImage.replace("ipfs://", "https://gateway.ipfs.io/ipfs/") + if (tokenImage?.startsWith("ipfs://")) { + tokenImage = tokenImage.replace( + "ipfs://", + "https://gateway.ipfs.io/ipfs/" + ) } setTokenImage(tokenImage) setTokenName(token.name) diff --git a/apps/www/registry/default/buidl/erc20/erc20-name.tsx b/apps/www/registry/default/buidl/erc20/erc20-name.tsx index b211215..ee6da71 100644 --- a/apps/www/registry/default/buidl/erc20/erc20-name.tsx +++ b/apps/www/registry/default/buidl/erc20/erc20-name.tsx @@ -54,7 +54,7 @@ export const Erc20Name = ({ if (!tokenName) { const Comp = unavailable - if(!Comp) return null + if (!Comp) return null return } diff --git a/apps/www/registry/default/buidl/erc20/erc20-select-and-amount.tsx b/apps/www/registry/default/buidl/erc20/erc20-select-and-amount.tsx index c9f4794..2039637 100644 --- a/apps/www/registry/default/buidl/erc20/erc20-select-and-amount.tsx +++ b/apps/www/registry/default/buidl/erc20/erc20-select-and-amount.tsx @@ -1,11 +1,12 @@ -import { type Dispatch, type SetStateAction } from "react" -import { useEffect, useState } from "react" +import { useEffect, useState, type Dispatch, type SetStateAction } from "react" +import defaultTokenList from "@/data/uniswap-default.tokenlist.json" +import { useChainId } from "wagmi" + +import { cn } from "@/lib/utils" + import { Erc20Selector } from "./erc20-selector" import { Token, TokenList } from "./types" -import { useChainId } from "wagmi" import { filterTokenListByChainId } from "./utils/filter-token-list-by-chain-id" -import defaultTokenList from "@/data/uniswap-default.tokenlist.json" -import { cn } from "@/lib/utils" type Erc20SelectAndAmountProps = React.HTMLAttributes & { chainId?: number @@ -23,7 +24,10 @@ export function Erc20SelectAndAmount({ onAmountUpdate, onTokenSelectUpdate, }: Erc20SelectAndAmountProps) { - const classes = cn('group relative flex items-center justify-between gap-2 rounded-md border p-2', className) + const classes = cn( + "group relative flex items-center justify-between gap-2 rounded-md border p-2", + className + ) const chainIdDefault = useChainId() // Select Token @@ -33,7 +37,7 @@ export function Erc20SelectAndAmount({ onTokenSelectUpdate?.(selectedToken) } }, [selectedToken, onTokenSelectUpdate]) - + // Amount Update const [amount, setAmount] = useState() useEffect(() => { diff --git a/apps/www/registry/default/buidl/erc20/erc20-selector.tsx b/apps/www/registry/default/buidl/erc20/erc20-selector.tsx index ddb2114..899c662 100644 --- a/apps/www/registry/default/buidl/erc20/erc20-selector.tsx +++ b/apps/www/registry/default/buidl/erc20/erc20-selector.tsx @@ -4,6 +4,7 @@ import { useCallback, useMemo, useState } from "react" import Image from "next/image" import { cn } from "@/lib/utils" + import { CommandDialog, CommandEmpty, @@ -11,9 +12,8 @@ import { CommandItem, CommandList, } from "../../ui/command" - -import { Token, TokenList } from "./types" import { ImageIpfs } from "../image-ipfs" +import { Token, TokenList } from "./types" interface Erc20SelectorProps { disabled?: boolean @@ -67,7 +67,7 @@ export function Erc20Selector({ onClick={() => (!disabled ? setOpen(true) : undefined)} > {selectedToken && ( -
+
} diff --git a/apps/www/registry/default/buidl/erc20/token-select.tsx b/apps/www/registry/default/buidl/erc20/token-select.tsx index 5b80d5f..5358973 100644 --- a/apps/www/registry/default/buidl/erc20/token-select.tsx +++ b/apps/www/registry/default/buidl/erc20/token-select.tsx @@ -1,5 +1,3 @@ - - import { Erc20Selector } from "./erc20-selector" import { Token, TokenList } from "./types" diff --git a/apps/www/registry/default/buidl/image-ipfs.tsx b/apps/www/registry/default/buidl/image-ipfs.tsx index 8c99ad6..e5d59f4 100644 --- a/apps/www/registry/default/buidl/image-ipfs.tsx +++ b/apps/www/registry/default/buidl/image-ipfs.tsx @@ -1,26 +1,28 @@ import { useEffect, useState } from "react" -import { cn } from '@/lib/utils'; + +import { cn } from "@/lib/utils" type ImageIpfs = React.HTMLAttributes & { - src: string; - alt: string; + src: string + alt: string } -export const ImageIpfs = ({ className, src, alt }: ImageIpfs) => { - const classes = cn(className); +export const ImageIpfs = ({ className, src, alt }: ImageIpfs) => { + const classes = cn(className) - const [imgSrc, setImgSrc] = useState() - useEffect(() => { - if(src?.startsWith("ipfs://")) { - setImgSrc(src.replace("ipfs://", "https://gateway.ipfs.io/ipfs/")) + const [imgSrc, setImgSrc] = useState() + useEffect(() => { + if (src?.startsWith("ipfs://")) { + setImgSrc(src.replace("ipfs://", "https://gateway.ipfs.io/ipfs/")) } else { - setImgSrc(src) + setImgSrc(src) } - }, [src]) + }, [src]) - if (!imgSrc) return null + if (!imgSrc) return null - return( - // eslint-disable-next-line @next/next/no-img-element - {alt} -)} \ No newline at end of file + return ( + // eslint-disable-next-line @next/next/no-img-element + {alt} + ) +} diff --git a/apps/www/registry/default/buidl/wallet-connect.tsx b/apps/www/registry/default/buidl/wallet-connect.tsx index 1939d7b..13b4c24 100644 --- a/apps/www/registry/default/buidl/wallet-connect.tsx +++ b/apps/www/registry/default/buidl/wallet-connect.tsx @@ -1,9 +1,12 @@ +"use client" + import * as React from "react" +import { useState } from "react" import Image from "next/image" import { connect } from "@wagmi/core" import { CoinbaseWalletConnector } from "@wagmi/core/dist/connectors/coinbaseWallet" import { MetaMaskConnector } from "@wagmi/core/dist/connectors/metaMask" -import { ChevronRight } from "lucide-react" +import { ChevronRight, RefreshCcw, Rewind } from "lucide-react" import { connectors } from "@/config/connectors" import { cn } from "@/lib/utils" @@ -21,10 +24,9 @@ import { type WalletConnect = React.HTMLAttributes export const WalletConnect = ({ children, className }: WalletConnect) => { - console.log(connectors, "connectors") const classes = cn(className) - const [isError, setIsError] = React.useState() - const [selectedConnectorId, setSelectedConnectorId] = React.useState< + const [isError, setIsError] = useState() + const [selectedConnectorId, setSelectedConnectorId] = useState< string | undefined >() @@ -50,8 +52,8 @@ export const WalletConnect = ({ children, className }: WalletConnect) => {
{selectedConnectorId && ( <> -
- +
+ Back
Accept the connection request in your wallet

diff --git a/apps/www/registry/default/buidl/wallet-disconnect.tsx b/apps/www/registry/default/buidl/wallet-disconnect.tsx new file mode 100644 index 0000000..66a941b --- /dev/null +++ b/apps/www/registry/default/buidl/wallet-disconnect.tsx @@ -0,0 +1,33 @@ +"use client" + +import * as React from "react" +import { useDisconnect } from "wagmi" + +import { cn } from "@/lib/utils" + +import { Button, type ButtonProps } from "../ui/button" + +export interface WalletDisconnectProps extends ButtonProps { + label?: string +} + +export const WalletDisconnect = ({ + children, + className, + size, + variant, + label = "Disconnect", +}: WalletDisconnectProps) => { + const classes = cn(className) + const { disconnect } = useDisconnect() + return ( + + ) +} diff --git a/apps/www/registry/default/buidl/wallet-manage.tsx b/apps/www/registry/default/buidl/wallet-manage.tsx index 06d9549..6015813 100644 --- a/apps/www/registry/default/buidl/wallet-manage.tsx +++ b/apps/www/registry/default/buidl/wallet-manage.tsx @@ -1,3 +1,5 @@ +"use client" + import * as React from "react" import { cn } from "@/lib/utils" diff --git a/apps/www/registry/default/example/account-address-demo.tsx b/apps/www/registry/default/example/account-address-demo.tsx index 81aa68f..23be12f 100644 --- a/apps/www/registry/default/example/account-address-demo.tsx +++ b/apps/www/registry/default/example/account-address-demo.tsx @@ -8,10 +8,7 @@ export default function AddressDemo() { return (
-

BUIDL

-

RainbowKit

-

Default

diff --git a/apps/www/registry/default/example/account-blockie-demo.tsx b/apps/www/registry/default/example/account-blockie-demo.tsx index 7d3e5a0..f7e3e22 100644 --- a/apps/www/registry/default/example/account-blockie-demo.tsx +++ b/apps/www/registry/default/example/account-blockie-demo.tsx @@ -1,16 +1,24 @@ import { AccountBlockie } from "../buidl/account-blockie" +import { IsWalletConnected } from "../buidl/is-wallet-connected" +import { IsWalletDisconnected } from "../buidl/is-wallet-disconnected" +import { WalletConnect } from "../buidl/wallet-connect" export default function AccountBlockieDemo() { return (
-

Default

- -

Small

- -

Large

- -

Curved

- + + + + +

Default

+ +

Small

+ +

Large

+ +

Curved

+ +
) } diff --git a/apps/www/registry/default/example/account-ens-avatar-demo.tsx b/apps/www/registry/default/example/account-ens-avatar-demo.tsx index 891c321..d0d87f8 100644 --- a/apps/www/registry/default/example/account-ens-avatar-demo.tsx +++ b/apps/www/registry/default/example/account-ens-avatar-demo.tsx @@ -1,8 +1,15 @@ import { AccountEnsAvatar } from "../buidl/account-ens-avatar" +import { IsWalletConnected } from "../buidl/is-wallet-connected" +import { IsWalletDisconnected } from "../buidl/is-wallet-disconnected" +import { WalletConnect } from "../buidl/wallet-connect" export default function AccountEnsAvatarDemo() { return (
+ + + +

Default

@@ -14,6 +21,7 @@ export default function AccountEnsAvatarDemo() {

Curved

+
) } diff --git a/apps/www/registry/default/example/account-ens-name-demo.tsx b/apps/www/registry/default/example/account-ens-name-demo.tsx index 81b7647..8f90508 100644 --- a/apps/www/registry/default/example/account-ens-name-demo.tsx +++ b/apps/www/registry/default/example/account-ens-name-demo.tsx @@ -1,9 +1,18 @@ -// import { AccountEnsName } from "../buidl/account-ens-name" +import { AccountEnsName } from "../buidl/account-ens-name" + +import { IsWalletConnected } from "../buidl/is-wallet-connected"; +import { IsWalletDisconnected } from "../buidl/is-wallet-disconnected"; +import { WalletConnect } from "../buidl/wallet-connect"; export default function AccountEnsNameDemo() { return (
- {/* */} + + + + + +
) } diff --git a/apps/www/registry/registry.ts b/apps/www/registry/registry.ts index 914bf13..c953599 100644 --- a/apps/www/registry/registry.ts +++ b/apps/www/registry/registry.ts @@ -85,12 +85,12 @@ const ui: Registry = [ dependencies: ["wagmi"], files: ["buidl/erc20/erc20-select-and-amount.tsx"], }, - { - name: "accordion", - type: "components:ui", - dependencies: ["wagmi"], - files: ["ui/accordion.tsx"], - }, + // { + // name: "accordion", + // type: "components:ui", + // dependencies: ["wagmi"], + // files: ["ui/accordion.tsx"], + // }, ] const example: Registry = [ @@ -196,12 +196,12 @@ const example: Registry = [ registryDependencies: ["erc20-select-and-amount"], files: ["example/erc20-select-and-amount-demo.tsx"], }, - { - name: "accordion-demo", - type: "components:example", - registryDependencies: ["accordion"], - files: ["example/accordion-demo.tsx"], - }, + // { + // name: "accordion-demo", + // type: "components:example", + // registryDependencies: ["accordion"], + // files: ["example/accordion-demo.tsx"], + // }, ] export const registry: Registry = [...ui, ...example] diff --git a/apps/www/scripts/build-registry.ts b/apps/www/scripts/build-registry.ts index edb5890..8064aa1 100644 --- a/apps/www/scripts/build-registry.ts +++ b/apps/www/scripts/build-registry.ts @@ -49,9 +49,9 @@ for (const style of styles) { name: "${item.name}", type: "${item.type}", registryDependencies: ${JSON.stringify(item.registryDependencies)}, - component: React.lazy(() => import("@/registry/${style.name}/${type}/${item.folder ? `${item.folder}/` : ""}${ - item.name - }")), + component: React.lazy(() => import("@/registry/${style.name}/${type}/${ + item.folder ? `${item.folder}/` : "" + }${item.name}")), files: [${resolveFiles.map((file) => `"${file}"`)}], },` }