Files
market/components/ConnectWalletButton.tsx
artemis prime 92278b2f7f fixed color scales:
gray =  mix of radix (grayDark) and Zach's selected values
primary = slate
secondary = slateDark
Voila! Since all original code used the Radix guidelines (which I references and link to in the config file), it all just works.
So removed most of my mods to colors from first PR (checking intent and result of each carefully).
Did not touch light theme (TODO?)
NOTE: using the $ notation within the theme itself seems to break,
so I grabbed the actual hex values from Radix.
2023-01-22 21:16:16 -05:00

68 lines
1.9 KiB
TypeScript

import { ConnectButton } from '@rainbow-me/rainbowkit'
import { Avatar } from 'components/primitives/Avatar'
import Box from 'components/primitives/Box'
import Button from 'components/primitives/Button'
import { FC } from 'react'
import Jazzicon, { jsNumberForAddress } from 'react-jazzicon'
type Props = {}
export const ConnectWalletButton: FC<Props> = () => {
return (
<ConnectButton.Custom>
{({ account, chain, openAccountModal, openConnectModal, mounted }) => {
return (
<Box
style={{
flex: '1',
display: 'flex',
justifyContent: 'flex',
}}
{...(!mounted && {
'aria-hidden': true,
style: {
opacity: 0,
pointerEvents: 'none',
userSelect: 'none',
},
})}
>
{(() => {
if (!mounted || !account || !chain) {
return (
<Button
color='primary'
onClick={openConnectModal}
type="button"
>
Connect
</Button>
)
}
return (
<Button
css={{
justifyContent: 'center',
}}
corners="circle"
onClick={openAccountModal}
type="button"
>
{account.ensAvatar ? (
<Avatar size="small" src={account.ensAvatar} />
) : (
<Jazzicon
diameter={44}
seed={jsNumberForAddress(account.address)}
/>
)}
</Button>
)
})()}
</Box>
)
}}
</ConnectButton.Custom>
)
}