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': {
backgroundColor: `$${color}3`,
},
'&:disabled': {
backgroundColor: `initial`,
'&:hover': {
color: `$${color}11`,
backgroundColor: `initial`,
},
'& img, & svg': {
filter: 'grayscale(100%)',
},
},
};
default:

View File

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

View File

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