chore: UI transition when wallet is already connected (#177)

* chore: wallet auto transition when already connected

* chore: display connected address

* chore: skip first step if wallet connected

* chore: remove useeffect from mint stepper
This commit is contained in:
Camila Sosa Morales 2023-05-10 11:44:19 -03:00 committed by GitHub
parent 70f2df4210
commit d2bad871c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 20 deletions

View File

@ -126,17 +126,6 @@ const getButtonCompoundVariant = ({
'&:focus, &:active': { '&:focus, &:active': {
backgroundColor: `$${color}3`, backgroundColor: `$${color}3`,
}, },
'&:disabled': {
backgroundColor: `initial`,
'&:hover': {
color: `$${color}11`,
backgroundColor: `initial`,
},
'& img, & svg': {
filter: 'grayscale(100%)',
},
},
}; };
default: default:

View File

@ -12,6 +12,7 @@ export const MintStepper: React.FC = () => {
const { const {
transaction: { isSuccess }, transaction: { isSuccess },
} = Mint.useTransactionContext(); } = Mint.useTransactionContext();
const { const {
form: { form: {
isValid: [, setIsValid], isValid: [, setIsValid],

View File

@ -1,6 +1,6 @@
import { ConnectKitButton } from 'connectkit'; import { ConnectKitButton } from 'connectkit';
import { Button, Stepper } from '@/components'; import { Stepper } from '@/components';
import { ButtonConnection } from '../button-connection'; import { ButtonConnection } from '../button-connection';
@ -9,19 +9,14 @@ export const ConnectWalletButton: React.FC = () => {
return ( return (
<ConnectKitButton.Custom> <ConnectKitButton.Custom>
{({ isConnected, show, truncatedAddress, address }) => { {({ isConnected, show, address }) => {
if (isConnected && address) { if (isConnected && address) {
return ( nextStep();
<Button onClick={nextStep} css={{ color: '$slate12' }}>
{truncatedAddress}. Continue
</Button>
);
} else { } else {
return ( return (
<ButtonConnection <ButtonConnection
icon={'ethereum'} icon={'ethereum'}
label={'Connect Wallet'} label={'Connect Wallet'}
disabled={isConnected}
onClick={show} onClick={show}
/> />
); );