-
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.
- Loading branch information
Showing
32 changed files
with
791 additions
and
593 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
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
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 |
---|---|---|
@@ -1,21 +1,17 @@ | ||
import type { ButtonProps } from '@chakra-ui/react' | ||
import { Button, VStack } from '@chakra-ui/react' | ||
import { Button } from '@chakra-ui/react' | ||
import { useAccount, useDisconnect } from 'wagmi' | ||
import { modal } from '../pages/index' | ||
|
||
interface Props { | ||
onConnect: ButtonProps['onClick'] | ||
} | ||
|
||
export function ConnectButton({ onConnect }: Props) { | ||
export function ConnectButton() { | ||
const { isConnected, address } = useAccount() | ||
const { disconnect } = useDisconnect() | ||
|
||
return isConnected ? ( | ||
<VStack gap={4}> | ||
<Button onClick={onConnect}>{address}</Button> | ||
<> | ||
<Button onClick={() => modal.open()}>{address}</Button> | ||
<Button onClick={() => disconnect()}>Disconnect</Button> | ||
</VStack> | ||
</> | ||
) : ( | ||
<Button onClick={onConnect}>Connect Wallet</Button> | ||
<Button onClick={() => modal.open()}>Connect Wallet</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,11 @@ | ||
import { Button } from '@chakra-ui/react' | ||
import { useNetwork } from 'wagmi' | ||
import { modal } from '../pages/index' | ||
|
||
export function NetworksButton() { | ||
const { chain } = useNetwork() | ||
|
||
return ( | ||
<Button onClick={() => modal.open({ view: 'Networks' })}>{chain?.name ?? 'Networks'}</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
Oops, something went wrong.
e3410d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web3modal-laboratory – ./
web3modal-laboratory-v3.vercel.app
web3modal-laboratory-walletconnect1.vercel.app
web3modal-laboratory-git-v3-walletconnect1.vercel.app