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:
parent
70f2df4210
commit
d2bad871c3
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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],
|
||||||
|
|
|
||||||
|
|
@ -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}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue