11import { Box , Button , Flex , Icon , Text } from "@chakra-ui/react"
2- import React , { useMemo , useState } from "react"
2+ import React , { useEffect , useMemo , useState } from "react"
33import {
44 RiPriceTag2Line ,
55 RiAuctionLine ,
66 RiFileTransferLine ,
77} from "react-icons/ri"
88import { AnimatePresence , motion } from "framer-motion"
9- import { Slider } from "./Slider "
10- import { Web3App } from "./Web3App "
9+ import GatsbyImage from "../../../GatsbyImage "
10+ import { NotificationPopover } from "../../NotificationPopover "
1111import { ProgressCta } from "../../ProgressCta"
1212import { WalletHome } from "../../WalletHome"
13- import type { PhoneScreenProps } from "../../interfaces"
1413import type { TokenBalance } from "../../WalletHome/interfaces"
15- import { defaultTokenBalances } from "../../constants"
16- import { useEthPrice } from "../../../../hooks/useEthPrice"
1714import { useNFT } from "../../WalletHome/hooks/useNFT"
18- import GatsbyImage from "../../../GatsbyImage"
19- import { FALLBACK_ETH_PRICE , USD_RECEIVE_AMOUNT } from "../../constants"
20- import { EXAMPLE_APP_URL } from "./constants"
2115import { Browser } from "./Browser"
22- import { NotificationPopover } from "../../NotificationPopover"
16+ import { Slider } from "./Slider"
17+ import { Web3App } from "./Web3App"
18+ import {
19+ defaultTokenBalances ,
20+ FALLBACK_ETH_PRICE ,
21+ USD_RECEIVE_AMOUNT ,
22+ BASE_ANIMATION_DELAY_SEC ,
23+ } from "../../constants"
24+ import { EXAMPLE_APP_URL } from "./constants"
25+ import type { PhoneScreenProps } from "../../interfaces"
26+ import { useEthPrice } from "../../../../hooks/useEthPrice"
2327
2428export const ConnectWeb3 : React . FC < PhoneScreenProps > = ( { nav, ctaLabel } ) => {
2529 const { progressStepper, step } = nav
@@ -45,6 +49,17 @@ export const ConnectWeb3: React.FC<PhoneScreenProps> = ({ nav, ctaLabel }) => {
4549 initial : { opacity : 0 } ,
4650 animate : { opacity : 1 } ,
4751 }
52+
53+ // Enable ProgressCta button after short delay for first step
54+ const [ ctaDisabled , setCtaDisabled ] = useState ( step === 0 )
55+ useEffect ( ( ) => {
56+ if ( step !== 0 ) return
57+ const timeout = setTimeout ( ( ) => {
58+ setCtaDisabled ( false )
59+ } , BASE_ANIMATION_DELAY_SEC * 1000 )
60+ return ( ) => clearTimeout ( timeout )
61+ } , [ ] )
62+
4863 return (
4964 < >
5065 { [ 0 ] . includes ( step ) && < Browser progressStepper = { progressStepper } /> }
@@ -173,6 +188,7 @@ export const ConnectWeb3: React.FC<PhoneScreenProps> = ({ nav, ctaLabel }) => {
173188 { [ 0 , 1 , 2 , 3 , 4 ] . includes ( step ) && (
174189 < ProgressCta
175190 isAnimated = { step === 0 }
191+ isDisabled = { ctaDisabled }
176192 progressStepper = { progressStepper }
177193 mb = { step === 0 ? 16 : 0 }
178194 >
0 commit comments