-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
:feat new account page + receive flow (#2011)
- Loading branch information
1 parent
91f1254
commit eede7d2
Showing
59 changed files
with
1,795 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import '@web3modal/ui/src/composites/wui-balance' | ||
import type { WuiBalance } from '@web3modal/ui/src/composites/wui-balance' | ||
import { html } from 'lit' | ||
|
||
type Component = Meta<WuiBalance> | ||
|
||
export default { | ||
title: 'Composites/wui-balance', | ||
args: { | ||
dollars: '4,798', | ||
pennies: '75' | ||
} | ||
} as Component | ||
|
||
export const Default: Component = { | ||
render: args => html`<wui-balance pennies=${args.pennies} dollars=${args.dollars}></wui-balance>` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import '@web3modal/ui/src/composites/wui-banner' | ||
import type { WuiBanner } from '@web3modal/ui/src/composites/wui-banner' | ||
import { html } from 'lit' | ||
import { iconOptions } from '../../utils/PresetUtils' | ||
import '../../components/gallery-container' | ||
|
||
type Component = Meta<WuiBanner> | ||
|
||
export default { | ||
title: 'Composites/wui-banner', | ||
args: { | ||
text: 'You can only receive assets on these networks', | ||
icon: 'warningCircle' | ||
}, | ||
argTypes: { | ||
icon: { | ||
options: iconOptions, | ||
control: { type: 'select' } | ||
} | ||
} | ||
} as Component | ||
|
||
export const Default: Component = { | ||
render: args => | ||
html` <gallery-container width="336" | ||
><wui-banner icon=${args.icon} text=${args.text}></wui-banner | ||
></gallery-container>` | ||
} |
42 changes: 42 additions & 0 deletions
42
apps/gallery/stories/composites/wui-chip-button.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import '@web3modal/ui/src/composites/wui-chip-button' | ||
import type { WuiChipButton } from '@web3modal/ui/src/composites/wui-chip-button' | ||
import { html } from 'lit' | ||
import { chipOptions, iconOptions, walletImagesOptions } from '../../utils/PresetUtils' | ||
|
||
type Component = Meta<WuiChipButton> | ||
|
||
export default { | ||
title: 'Composites/wui-chip-button', | ||
args: { | ||
variant: 'fill', | ||
disabled: false, | ||
icon: 'externalLink', | ||
imageSrc: walletImagesOptions[3]?.src, | ||
text: 'dianeyes.walletconnect.eth' | ||
}, | ||
argTypes: { | ||
variant: { | ||
options: chipOptions, | ||
control: { type: 'select' } | ||
}, | ||
icon: { | ||
options: iconOptions, | ||
control: { type: 'select' } | ||
}, | ||
disabled: { | ||
control: { type: 'boolean' } | ||
} | ||
} | ||
} as Component | ||
|
||
export const Default: Component = { | ||
render: args => | ||
html`<wui-chip-button | ||
icon=${args.icon} | ||
text=${args.text} | ||
variant=${args.variant} | ||
?disabled=${args.disabled} | ||
.imageSrc=${args.imageSrc} | ||
></wui-chip-button>` | ||
} |
22 changes: 22 additions & 0 deletions
22
apps/gallery/stories/composites/wui-compatible-network.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import '@web3modal/ui/src/composites/wui-compatible-network' | ||
import type { WuiCompatibleNetwork } from '@web3modal/ui/src/composites/wui-compatible-network' | ||
import { html } from 'lit' | ||
import { networkImages } from '../../utils/PresetUtils' | ||
|
||
type Component = Meta<WuiCompatibleNetwork> | ||
|
||
export default { | ||
title: 'Composites/wui-compatible-network', | ||
args: { | ||
text: 'Only receive assets on these networks"', | ||
networkImages | ||
} | ||
} as Component | ||
|
||
export const Default: Component = { | ||
render: args => html` | ||
<wui-compatible-network .networkImages=${args.networkImages} .text=${args.text}> | ||
</wui-compatible-network> | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
apps/gallery/stories/composites/wui-profile-button.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import '@web3modal/ui/src/composites/wui-profile-button' | ||
import type { WuiProfileButton } from '@web3modal/ui/src/composites/wui-profile-button' | ||
import { html } from 'lit' | ||
import { address, avatarImageSrc, networkImageSrc } from '../../utils/PresetUtils' | ||
|
||
type Component = Meta<WuiProfileButton> | ||
|
||
export default { | ||
title: 'Composites/wui-profile-button', | ||
args: { | ||
networkSrc: networkImageSrc, | ||
avatarSrc: avatarImageSrc, | ||
address, | ||
isProfileName: false | ||
}, | ||
argTypes: { | ||
isProfileName: { | ||
control: { type: 'boolean' } | ||
} | ||
} | ||
} as Component | ||
|
||
export const Default: Component = { | ||
render: args => | ||
html`<wui-profile-button | ||
?isProfileName=${args.isProfileName} | ||
.networkSrc=${args.networkSrc} | ||
.avatarSrc=${args.avatarSrc} | ||
address=${args.address} | ||
></wui-profile-button>` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import '@web3modal/ui/src/composites/wui-promo' | ||
import type { WuiPromo } from '@web3modal/ui/src/composites/wui-promo' | ||
import { html } from 'lit' | ||
|
||
type Component = Meta<WuiPromo> | ||
|
||
export default { | ||
title: 'Composites/wui-promo', | ||
args: { | ||
text: 'Activate your account' | ||
} | ||
} as Component | ||
|
||
export const Default: Component = { | ||
render: args => html`<wui-promo text=${args.text}></wui-promo>` | ||
} |
30 changes: 30 additions & 0 deletions
30
apps/gallery/stories/composites/wui-tooltip-select.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import '@web3modal/ui/src/composites/wui-tooltip-select' | ||
import type { WuiTooltipSelect } from '@web3modal/ui/src/composites/wui-tooltip-select' | ||
import { html } from 'lit' | ||
import '../../components/gallery-container' | ||
import { iconOptions } from '../../utils/PresetUtils' | ||
|
||
type Component = Meta<WuiTooltipSelect> | ||
|
||
export default { | ||
title: 'Composites/wui-tooltip-select', | ||
args: { | ||
icon: 'card', | ||
text: 'Buy' | ||
}, | ||
argTypes: { | ||
icon: { | ||
options: iconOptions, | ||
control: { type: 'select' } | ||
} | ||
} | ||
} as Component | ||
|
||
export const Default: Component = { | ||
render: args => html` | ||
<gallery-container width="120" | ||
><wui-tooltip-select icon=${args.icon} text=${args.text}></wui-tooltip-select> | ||
</gallery-container> | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { createWeb3Modal, defaultConfig } from '@web3modal/ethers/react' | ||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { EthersConstants } from '../../utils/EthersConstants' | ||
import { ConstantsUtil } from '../../utils/ConstantsUtil' | ||
import { EthersTests } from '../../components/Ethers/EthersTests' | ||
import { Web3ModalButtons } from '../../components/Web3ModalButtons' | ||
|
||
const modal = createWeb3Modal({ | ||
ethersConfig: defaultConfig({ | ||
metadata: ConstantsUtil.Metadata, | ||
defaultChainId: 1, | ||
rpcUrl: 'https://cloudflare-eth.com', | ||
enableEmail: true | ||
}), | ||
chains: EthersConstants.chains, | ||
projectId: ConstantsUtil.ProjectId, | ||
enableAnalytics: true, | ||
metadata: ConstantsUtil.Metadata, | ||
termsConditionsUrl: 'https://walletconnect.com/terms', | ||
privacyPolicyUrl: 'https://walletconnect.com/privacy', | ||
enableOnramp: true, | ||
customWallets: ConstantsUtil.CustomWallets, | ||
enableWalletFeatures: true | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Ethers() { | ||
return ( | ||
<> | ||
<Web3ModalButtons /> | ||
<EthersTests /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { createWeb3Modal } from '@web3modal/wagmi/react' | ||
import { defaultWagmiConfig } from '@web3modal/wagmi/react/config' | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
import { useEffect, useState } from 'react' | ||
import { WagmiProvider } from 'wagmi' | ||
import { Web3ModalButtons } from '../../components/Web3ModalButtons' | ||
import { WagmiTests } from '../../components/Wagmi/WagmiTests' | ||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { WagmiConstantsUtil } from '../../utils/WagmiConstants' | ||
import { ConstantsUtil } from '../../utils/ConstantsUtil' | ||
|
||
const queryClient = new QueryClient() | ||
|
||
export const wagmiConfig = defaultWagmiConfig({ | ||
chains: WagmiConstantsUtil.chains, | ||
projectId: ConstantsUtil.ProjectId, | ||
metadata: ConstantsUtil.Metadata, | ||
enableEmail: true, | ||
ssr: true | ||
}) | ||
|
||
const modal = createWeb3Modal({ | ||
wagmiConfig, | ||
projectId: ConstantsUtil.ProjectId, | ||
enableAnalytics: true, | ||
metadata: ConstantsUtil.Metadata, | ||
termsConditionsUrl: 'https://walletconnect.com/terms', | ||
privacyPolicyUrl: 'https://walletconnect.com/privacy', | ||
enableOnramp: true, | ||
customWallets: ConstantsUtil.CustomWallets, | ||
enableWalletFeatures: true | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Wagmi() { | ||
const [ready, setReady] = useState(false) | ||
|
||
useEffect(() => { | ||
setReady(true) | ||
}, []) | ||
|
||
return ready ? ( | ||
<WagmiProvider config={wagmiConfig}> | ||
<QueryClientProvider client={queryClient}> | ||
<Web3ModalButtons /> | ||
<WagmiTests /> | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
) : null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.