mirror of
https://github.com/zoo-labs/zoo.git
synced 2026-11-10 22:32:34 +00:00
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { ConnectButton } from '@rainbow-me/rainbowkit'
|
|
import Box from 'components/primitives/Box'
|
|
import Button from 'components/primitives/Button'
|
|
import { FC } from 'react'
|
|
|
|
type Props = {}
|
|
|
|
export const ConnectWalletButton: FC<Props> = () => {
|
|
return (
|
|
<ConnectButton.Custom>
|
|
{({ account, chain, openConnectModal, mounted }) => {
|
|
return (
|
|
<Box
|
|
style={{
|
|
flex: '1',
|
|
display: 'flex',
|
|
justifyContent: 'flex',
|
|
}}
|
|
>
|
|
{(() => {
|
|
if (!mounted || !account || !chain) {
|
|
return (
|
|
<Button
|
|
css={{ flex: 1, justifyContent: 'center' }}
|
|
corners="rounded"
|
|
onClick={openConnectModal}
|
|
type="button"
|
|
>
|
|
Connect Wallet
|
|
</Button>
|
|
)
|
|
}
|
|
})()}
|
|
</Box>
|
|
)
|
|
}}
|
|
</ConnectButton.Custom>
|
|
)
|
|
}
|