From d2bad871c37b88f93c4adcf873919aba9204103e Mon Sep 17 00:00:00 2001 From: Camila Sosa Morales Date: Wed, 10 May 2023 11:44:19 -0300 Subject: [PATCH] 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 --- ui/src/components/core/button/button.styles.ts | 11 ----------- ui/src/views/mint/mint-stepper.tsx | 1 + .../mint/wallet-step/connect-wallet-button.tsx | 13 ++++--------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/ui/src/components/core/button/button.styles.ts b/ui/src/components/core/button/button.styles.ts index 0c3756b..884d3a4 100644 --- a/ui/src/components/core/button/button.styles.ts +++ b/ui/src/components/core/button/button.styles.ts @@ -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: diff --git a/ui/src/views/mint/mint-stepper.tsx b/ui/src/views/mint/mint-stepper.tsx index 7fbf817..a4b5306 100644 --- a/ui/src/views/mint/mint-stepper.tsx +++ b/ui/src/views/mint/mint-stepper.tsx @@ -12,6 +12,7 @@ export const MintStepper: React.FC = () => { const { transaction: { isSuccess }, } = Mint.useTransactionContext(); + const { form: { isValid: [, setIsValid], diff --git a/ui/src/views/mint/wallet-step/connect-wallet-button.tsx b/ui/src/views/mint/wallet-step/connect-wallet-button.tsx index a0e3441..273747e 100644 --- a/ui/src/views/mint/wallet-step/connect-wallet-button.tsx +++ b/ui/src/views/mint/wallet-step/connect-wallet-button.tsx @@ -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 ( - {({ isConnected, show, truncatedAddress, address }) => { + {({ isConnected, show, address }) => { if (isConnected && address) { - return ( - - ); + nextStep(); } else { return ( );