Skip to content

Commit

Permalink
Refactor: components (#3)
Browse files Browse the repository at this point in the history
* refactor: components docs

* refactor: standardize components

* refactor: buidl components
  • Loading branch information
marthendalnunes committed Dec 1, 2023
1 parent b7216df commit 1a2e4ad
Show file tree
Hide file tree
Showing 97 changed files with 1,087 additions and 533 deletions.
14 changes: 14 additions & 0 deletions apps/www/__registry__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ export const Index: Record<string, any> = {
component: React.lazy(() => import("@/registry/default/buidl/erc721/erc721-metadata")),
files: ["registry/default/buidl/erc721/erc721-metadata.tsx"],
},
"error-message": {
name: "error-message",
type: "components:buidl",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/buidl/error-message")),
files: ["registry/default/buidl/error-message.tsx"],
},
"nonce-demo": {
name: "nonce-demo",
type: "components:example",
Expand Down Expand Up @@ -439,5 +446,12 @@ export const Index: Record<string, any> = {
component: React.lazy(() => import("@/registry/default/example/erc721-metadata-demo")),
files: ["registry/default/example/erc721-metadata-demo.tsx"],
},
"error-message-demo": {
name: "error-message-demo",
type: "components:example",
registryDependencies: ["error-message"],
component: React.lazy(() => import("@/registry/default/example/error-message-demo")),
files: ["registry/default/example/error-message-demo.tsx"],
},
},
}
10 changes: 10 additions & 0 deletions apps/www/config/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,15 @@ export const docsConfig: DocsConfig = {
},
],
},
{
title: "Miscellaneous",
items: [
{
title: "Error Message",
href: "/docs/components/error-message",
items: [],
},
],
},
],
}
17 changes: 9 additions & 8 deletions apps/www/content/docs/components/balance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ wagmi:

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)
Expand All @@ -53,15 +57,12 @@ wagmi:
## Usage

```tsx
import {
GasPrice,
MaxFeePerGas,
MaxPriorityFeePerGas,
} from "@/registry/default/buidl/balance"
import { Balance } from "@/registry/default/buidl/balance"
```

```tsx
<GasPrice />
<MaxFeePerGas />
<MaxPriorityFeePerGas />
<Balance />
<Balance
address="0x0000000000000000000000000000000000000000"
/>
```
4 changes: 4 additions & 0 deletions apps/www/content/docs/components/block-number.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ wagmi:

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)
Expand Down
6 changes: 6 additions & 0 deletions apps/www/content/docs/components/blockie.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: Blockie
description: Display an account blockie identicon.
component: true
wagmi:
link: https://wagmi.sh/react/hooks/useAccount
---

<ComponentPreview
Expand Down Expand Up @@ -40,6 +42,10 @@ component: true
npm add ethereum-blockies-base64
```

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="blockie" />
Expand Down
1 change: 1 addition & 0 deletions apps/www/content/docs/components/ens-address.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ wagmi:
<Step>Install the following components:</Step>

- [Address](/docs/components/address)
- [ErrorMessage](/docs/components/error-message)

<Step>Copy and paste the following code into your project.</Step>

Expand Down
1 change: 1 addition & 0 deletions apps/www/content/docs/components/ens-avatar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ import { EnsAvatar } from "@/components/buidl/ens-avatar"

```tsx
<EnsAvatar address="0x0000000000000000000000000000000000000000" />
<EnsAvatar name="vitalik.eth" />
```
2 changes: 2 additions & 0 deletions apps/www/content/docs/components/ens-name.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ wagmi:
<Step>Install the following components:</Step>

- [Address](/docs/components/address)
- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

Expand All @@ -57,5 +58,6 @@ import { EnsName } from "@/components/buidl/ens-name"
```

```tsx
<EnsName />
<EnsName address="0x0000000000000000000000000000000000000000" />
```
8 changes: 8 additions & 0 deletions apps/www/content/docs/components/erc20-balance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ wagmi:

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc20-balance" />
Expand Down
8 changes: 8 additions & 0 deletions apps/www/content/docs/components/erc20-decimals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ wagmi:

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc20-decimals" />
Expand Down
10 changes: 10 additions & 0 deletions apps/www/content/docs/components/erc20-name.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: ERC20 Name
description: Display the name of an ERC20 token
component: true
wagmi:
link: https://wagmi.sh/react/hooks/useContractRead
---

<ComponentPreview
Expand Down Expand Up @@ -34,6 +36,14 @@ component: true

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc20-name" />
Expand Down
12 changes: 11 additions & 1 deletion apps/www/content/docs/components/erc20-symbol.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: ENS Symbol
title: ERC20 Symbol
description: Display the symbol of an ERC20 token
component: true
wagmi:
link: https://wagmi.sh/react/hooks/useContractRead
---

<ComponentPreview
Expand Down Expand Up @@ -34,6 +36,14 @@ component: true

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc20-symbol" />
Expand Down
16 changes: 13 additions & 3 deletions apps/www/content/docs/components/erc20-total-supply.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: ENS Symbol
description: Display the symbol of an ERC20 token
title: ERC20 Total Supply
description: Display the total supply of an ERC20 token.
component: true
wagmi:
link: https://wagmi.sh/react/hooks/useContractRead
---

<ComponentPreview
Expand Down Expand Up @@ -34,6 +36,14 @@ component: true

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc20-total-supply" />
Expand All @@ -51,5 +61,5 @@ import { Erc20Symbol } from "@/components/buidl/erc20-total-supply"
```

```tsx
<Erc20Symbol address="0x0000000000000000000000000000000000000000" />
<Erc20TotalSupply address="0x0000000000000000000000000000000000000000" />
```
24 changes: 19 additions & 5 deletions apps/www/content/docs/components/erc721-metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: ERC721 Metadata
description: Display the metadata of an ERC721 token.
component: true
wagmi:
link: https://wagmi.sh/react/hooks/useContractRead
---

<ComponentPreview
Expand Down Expand Up @@ -34,6 +36,14 @@ component: true

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc721-metadata" />
Expand All @@ -46,10 +56,14 @@ component: true

## Usage

```tsx
import { Erc721Name } from "@/registry/default/buidl/erc721/erc721-metadata"
```
````tsx
import { Erc721MetadataImage } from "@/registry/default/buidl/erc721/erc721-metadata"```
```tsx
<Erc721Name address="0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB" chainId={1} />
```
<Erc721MetadataImage
className="mt-1 h-[250px] w-[250px]"
address="0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
tokenId={1}
chainId={1}
/>
````
10 changes: 10 additions & 0 deletions apps/www/content/docs/components/erc721-name.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: ERC721 Name
description: Display the name of an ERC721 token
component: true
wagmi:
link: https://wagmi.sh/react/hooks/useContractRead
---

<ComponentPreview
Expand Down Expand Up @@ -34,6 +36,14 @@ component: true

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc721-name" />
Expand Down
17 changes: 15 additions & 2 deletions apps/www/content/docs/components/erc721-owner-of.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: ERC721 Owner Of
description: Display the owner of an ERC721 token
component: true
wagmi:
link: https://wagmi.sh/react/hooks/useContractRead
---

<ComponentPreview
Expand Down Expand Up @@ -34,6 +36,14 @@ component: true

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc721-owner-of" />
Expand All @@ -47,9 +57,12 @@ component: true
## Usage

```tsx
import { Erc20owner } from "@/components/buidl/erc721-owner-of"
import { Erc721OwnerOf } from "@/registry/default/buidl/erc721/erc721-owner-of"
```

```tsx
<Erc20owner address="0x0000000000000000000000000000000000000000" />
<Erc721OwnerOf
tokenId={1}
address="0x0000000000000000000000000000000000000000"
/>
```
14 changes: 12 additions & 2 deletions apps/www/content/docs/components/erc721-symbol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: ERC721 Symbol
description: Display the symbol of an ERC721 token
component: true
wagmi:
link: https://wagmi.sh/react/hooks/useContractRead
---

<ComponentPreview
Expand Down Expand Up @@ -34,6 +36,14 @@ component: true

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc721-symbol" />
Expand All @@ -47,9 +57,9 @@ component: true
## Usage

```tsx
import { Erc20Symbol } from "@/components/buidl/erc721-symbol"
import { Erc721Symbol } from "@/components/buidl/erc721-symbol"
```

```tsx
<Erc20Symbol address="0x0000000000000000000000000000000000000000" />
<Erc721Symbol address="0x0000000000000000000000000000000000000000" />
```

0 comments on commit 1a2e4ad

Please sign in to comment.