Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dashboard 2fa flow #1874

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/components/Faucet/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function Hero({
walletLinked,
projects,
walletAuthUrl,
needsMfa,
} = useContext(MetamaskProviderContext);

const isMobile = sdk.platformManager?.isMobile ?? false;
Expand Down Expand Up @@ -100,7 +101,7 @@ export default function Hero({
className,
)}
>
{(showInstallButton || !(metaMaskAccount)) && <EthIcon />}
<EthIcon />
<Text as="h1">
<span>
{network === "linea" && "Linea Sepolia"}
Expand All @@ -112,7 +113,7 @@ export default function Hero({
{showInstallButton
? "Install MetaMask for your browser to get started and request ETH."
: !Object.keys(projects).length
? walletLinked === undefined
? needsMfa ? "Your Infura Account requires 2-Factor Authentication" : walletLinked === undefined
? "Connect your MetaMask wallet to get started and request ETH."
: walletLinked === WALLET_LINK_TYPE.NO
? "Link your Infura account to get started and request ETH."
Expand Down Expand Up @@ -154,6 +155,15 @@ export default function Hero({
</Button>
) : !Object.keys(projects).length ? (
<>
{needsMfa ?
<Button
testId="hero-cta-enter-mfa"
className={styles.button}
onClick={() => (window.location.href = walletAuthUrl)}
>
Authenticate
</Button>
: <>
{walletLinked === undefined && (
<Button
testId="hero-cta-connect-metamask"
Expand Down Expand Up @@ -184,6 +194,8 @@ export default function Hero({
Select Infura Account
</Button>
)}
</>
}
</>
) : (
<Button
Expand Down
Loading