Skip to content

Commit

Permalink
feat: move account components to primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
marthendalnunes committed Nov 29, 2023
1 parent 8afbb6b commit db5d0af
Show file tree
Hide file tree
Showing 52 changed files with 561 additions and 865 deletions.
94 changes: 26 additions & 68 deletions apps/www/__registry__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,6 @@ import * as React from "react"

export const Index: Record<string, any> = {
"default": {
"account-address": {
name: "account-address",
type: "components:buidl",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/buidl/account-address")),
files: ["registry/default/buidl/account-address.tsx"],
},
"account-blockie": {
name: "account-blockie",
type: "components:buidl",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/buidl/account-blockie")),
files: ["registry/default/buidl/account-blockie.tsx"],
},
"account-ens-avatar": {
name: "account-ens-avatar",
type: "components:buidl",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/buidl/account-ens-avatar")),
files: ["registry/default/buidl/account-ens-avatar.tsx"],
},
"account-ens-name": {
name: "account-ens-name",
type: "components:buidl",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/buidl/account-ens-name")),
files: ["registry/default/buidl/account-ens-name.tsx"],
},
"account-nonce": {
name: "account-nonce",
type: "components:buidl",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/buidl/account-nonce")),
files: ["registry/default/buidl/account-nonce.tsx"],
},
"address": {
name: "address",
type: "components:buidl",
Expand Down Expand Up @@ -68,6 +33,13 @@ export const Index: Record<string, any> = {
component: React.lazy(() => import("@/registry/default/buidl/block-number")),
files: ["registry/default/buidl/block-number.tsx"],
},
"nonce": {
name: "nonce",
type: "components:buidl",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/buidl/nonce")),
files: ["registry/default/buidl/nonce.tsx"],
},
"transaction": {
name: "transaction",
type: "components:buidl",
Expand Down Expand Up @@ -117,6 +89,13 @@ export const Index: Record<string, any> = {
component: React.lazy(() => import("@/registry/default/buidl/ens-name")),
files: ["registry/default/buidl/ens-name.tsx"],
},
"ens-address": {
name: "ens-address",
type: "components:buidl",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/buidl/ens-address")),
files: ["registry/default/buidl/ens-address.tsx"],
},
"image-ipfs": {
name: "image-ipfs",
type: "components:buidl",
Expand Down Expand Up @@ -208,40 +187,12 @@ export const Index: Record<string, any> = {
component: React.lazy(() => import("@/registry/default/buidl/erc20/erc20-symbol")),
files: ["registry/default/buidl/erc20/erc20-symbol.tsx"],
},
"account-address-demo": {
name: "account-address-demo",
type: "components:example",
registryDependencies: ["account-address"],
component: React.lazy(() => import("@/registry/default/example/account-address-demo")),
files: ["registry/default/example/account-address-demo.tsx"],
},
"account-blockie-demo": {
name: "account-blockie-demo",
"nonce-demo": {
name: "nonce-demo",
type: "components:example",
registryDependencies: ["account-blockie"],
component: React.lazy(() => import("@/registry/default/example/account-blockie-demo")),
files: ["registry/default/example/account-blockie-demo.tsx"],
},
"account-ens-avatar-demo": {
name: "account-ens-avatar-demo",
type: "components:example",
registryDependencies: ["account-ens-avatar"],
component: React.lazy(() => import("@/registry/default/example/account-ens-avatar-demo")),
files: ["registry/default/example/account-ens-avatar-demo.tsx"],
},
"account-ens-name-demo": {
name: "account-ens-name-demo",
type: "components:example",
registryDependencies: ["account-ens-name"],
component: React.lazy(() => import("@/registry/default/example/account-ens-name-demo")),
files: ["registry/default/example/account-ens-name-demo.tsx"],
},
"account-nonce-demo": {
name: "account-nonce-demo",
type: "components:example",
registryDependencies: ["account-nonce"],
component: React.lazy(() => import("@/registry/default/example/account-nonce-demo")),
files: ["registry/default/example/account-nonce-demo.tsx"],
registryDependencies: ["nonce"],
component: React.lazy(() => import("@/registry/default/example/nonce-demo")),
files: ["registry/default/example/nonce-demo.tsx"],
},
"address-demo": {
name: "address-demo",
Expand Down Expand Up @@ -320,6 +271,13 @@ export const Index: Record<string, any> = {
component: React.lazy(() => import("@/registry/default/example/ens-name-demo")),
files: ["registry/default/example/ens-name-demo.tsx"],
},
"ens-address-demo": {
name: "ens-address-demo",
type: "components:example",
registryDependencies: ["ens-address"],
component: React.lazy(() => import("@/registry/default/example/ens-address-demo")),
files: ["registry/default/example/ens-address-demo.tsx"],
},
"image-ipfs-demo": {
name: "image-ipfs-demo",
type: "components:example",
Expand Down
8 changes: 3 additions & 5 deletions apps/www/app/examples/authentication/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Metadata } from "next"
import Image from "next/image"
import Link from "next/link"

import { cn } from "@/lib/utils"
import { AccountAddress } from "@/registry/default/buidl/account-address"
import { AccountBlockie } from "@/registry/default/buidl/account-blockie"
import { Address } from "@/registry/default/buidl/address"
import { Blockie } from "@/registry/default/buidl/blockie"
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"
Expand Down Expand Up @@ -91,9 +89,9 @@ export default function AuthenticationPage() {
</IsWalletDisconnected>
<IsWalletConnected>
<div className="flex items-center justify-center gap-x-2">
<AccountBlockie />
<Blockie />
<Button size={"sm"} className="rounded-full">
<AccountAddress truncate linkEnabled />
<Address truncate link />
</Button>
<WalletDisconnect variant={"ghost"} size={"sm"} />
</div>
Expand Down
38 changes: 9 additions & 29 deletions apps/www/config/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ export const docsConfig: DocsConfig = {
href: "/docs/components/block-number",
items: [],
},
{
title: "Nonce",
href: "/docs/components/nonce",
items: [],
},
{
title: "Transaction",
href: "/docs/components/transaction",
Expand Down Expand Up @@ -141,38 +146,13 @@ export const docsConfig: DocsConfig = {
items: [],
},
{
title: "Image IPFS",
href: "/docs/components/image-ipfs",
items: [],
},
],
},
{
title: "Account",
items: [
{
title: "Account Address",
href: "/docs/components/account-address",
title: "ENS Address",
href: "/docs/components/ens-address",
items: [],
},
{
title: "Account Blockie",
href: "/docs/components/account-blockie",
items: [],
},
{
title: "Account ENS Avatar",
href: "/docs/components/account-ens-avatar",
items: [],
},
{
title: "Account ENS Name",
href: "/docs/components/account-ens-name",
items: [],
},
{
title: "Account Nonce",
href: "/docs/components/account-nonce",
title: "Image IPFS",
href: "/docs/components/image-ipfs",
items: [],
},
],
Expand Down
34 changes: 12 additions & 22 deletions apps/www/config/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,25 @@
import { env } from "@/env.mjs"
import { Chain, ChainProviderFn, configureChains } from "wagmi"
import {
goerli as goerliNoIcon,
arbitrum,
base,
gnosis,
mainnet,
optimism,
optimismGoerli,
sepolia as sepoliaNoIcon,
polygon,
} from "wagmi/chains"
import { alchemyProvider } from "wagmi/providers/alchemy"
import { infuraProvider } from "wagmi/providers/infura"
import { publicProvider } from "wagmi/providers/public"

const goerli = {
...goerliNoIcon,
iconUrl: "/icons/NetworkEthereumTest.svg",
}
const sepolia = {
...sepoliaNoIcon,
iconUrl: "/icons/NetworkEthereumTest.svg",
}

export const ETH_CHAINS_TEST = [goerli, sepolia, optimismGoerli]

export const ETH_CHAINS_PROD = [mainnet, optimism]
export const ETH_CHAINS_DEV =
env.NEXT_PUBLIC_PROD_NETWORKS_DEV === "true"
? [...ETH_CHAINS_PROD, ...ETH_CHAINS_TEST]
: [...ETH_CHAINS_TEST]

export const CHAINS: Chain[] =
process.env.NODE_ENV === "production" ? ETH_CHAINS_PROD : ETH_CHAINS_DEV
export const CHAINS: Chain[] = [
mainnet,
optimism,
polygon,
gnosis,
arbitrum,
base,
]

const PROVIDERS: ChainProviderFn<Chain>[] = []

Expand Down
61 changes: 0 additions & 61 deletions apps/www/content/docs/components/account-blockie.mdx

This file was deleted.

61 changes: 0 additions & 61 deletions apps/www/content/docs/components/account-ens-avatar.mdx

This file was deleted.

Loading

0 comments on commit db5d0af

Please sign in to comment.