-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConnectWalletButton.tsx
46 lines (44 loc) · 1.17 KB
/
ConnectWalletButton.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { ConnectKitButton } from 'connectkit'
import Box from 'components/primitives/Box'
import Button from 'components/primitives/Button'
import { FC } from 'react'
type Props = {}
export const ConnectWalletButton: FC<Props> = () => {
return (
<ConnectKitButton.Custom>
{({ isConnected, chain, show }) => {
return (
<Box
style={{
flex: '1',
display: 'flex',
justifyContent: 'flex',
}}
>
{(() => {
if (!isConnected || !chain) {
return (
<Button
css={{
flex: 1,
justifyContent: 'center',
'&:hover': {
background: '$gray8',
},
}}
color='gray3'
corners="rounded"
onClick={show}
type="button"
>
Connect Wallet
</Button>
)
}
})()}
</Box>
)
}}
</ConnectKitButton.Custom>
)
}