import React, { FC, PropsWithChildren, useCallback } from "react"; import { useWizard } from "react-use-wizard"; import { ArrowBackIcon, Pressable, View } from "native-base"; import { TransText } from "./Trans"; import { RedTentProps } from "../../apps/goodid/types"; import { useEthers } from "@usedapp/core"; import { SupportedChains } from "@gooddollar/web3sdk-v2"; const HeaderTitles = { default: /*i18n*/ "Claim", redtent: /*i18n*/ "GoodID Upgrade" }; export const UbiWizardHeader: FC< PropsWithChildren<{ onDone: RedTentProps["onDone"]; onExit: () => void; withNavBar: boolean }> > = ({ onDone, onExit, withNavBar = false, ...props }) => { const { activeStep } = useWizard(); const { chainId } = useEthers(); const handleBack = useCallback(() => { if (activeStep === 1 && chainId === SupportedChains.CELO) { void onDone(true); } else { onExit(); } }, [activeStep]); return withNavBar ? ( ) : null; };