diff --git a/src/components/Faucet/Alerts.tsx b/src/components/Faucet/Alerts.tsx index 003108d5bc5..6ab207452da 100644 --- a/src/components/Faucet/Alerts.tsx +++ b/src/components/Faucet/Alerts.tsx @@ -1,140 +1,166 @@ -import React from "react"; -import { AlertTitle, AlertText } from "@site/src/components/Alert"; -import { trackClickForSegment } from "@site/src/lib/segmentAnalytics"; +import React from 'react' +import { AlertTitle, AlertText } from '@site/src/components/Alert' +import { trackClickForSegment } from '@site/src/lib/segmentAnalytics' const handleClickCommonIssue = () => { trackClickForSegment({ - eventName: "Contact us", + eventName: 'Contact us', clickType: `Common Issue Alert`, - userExperience: "B", + userExperience: 'B', responseStatus: null, responseMsg: null, timestamp: Date.now(), - }); -}; + }) +} const handleClickBalanceLow = () => { trackClickForSegment({ - eventName: "Add funds using MetaMask", + eventName: 'Add funds using MetaMask', clickType: `Low Balance Alert`, - userExperience: "B", + userExperience: 'B', responseStatus: null, responseMsg: null, timestamp: Date.now(), - }); -}; + }) +} const handleClickCooldown = () => { trackClickForSegment({ - eventName: "Contact us", + eventName: 'Contact us', clickType: `Cooldown Alert`, - userExperience: "B", + userExperience: 'B', responseStatus: null, responseMsg: null, timestamp: Date.now(), - }); -}; + }) +} + +const handleClickPoh = () => { + trackClickForSegment({ + eventName: 'PoH', + clickType: `PoH Alert`, + userExperience: 'B', + responseStatus: null, + responseMsg: null, + timestamp: Date.now(), + }) +} const handleClickViewTransaction = () => { trackClickForSegment({ - eventName: "View on Etherscan", + eventName: 'View on Etherscan', clickType: `Success Alert`, - userExperience: "B", + userExperience: 'B', responseStatus: null, responseMsg: null, timestamp: Date.now(), - }); -}; + }) +} export const AlertCommonIssue = () => (
Issue starting transaction - There was an issue starting your transaction. Try again in a few - minutes. If the problem persists please{" "} + There was an issue starting your transaction. Try again in a few minutes. If the problem + persists please{' '} + href="https://support.metamask.io/"> contact support .
-); +) + +export const AlertFailedPoh = () => ( +
+ You haven't completed Linea Proof of Humanity + + + The address provided has not completed Linea Proof of Humanity. Please visit{' '} + + poh.linea.build + + . + + +
+) export const AlertPastActivity = () => (
No past activity - The address provided does not have sufficient historical activity or balance on the Ethereum Mainnet. Please use a - different address to proceed. Read the FAQ below for more information. + The address provided does not have sufficient historical activity or balance on the Ethereum + Mainnet. Please use a different address to proceed. Read the FAQ below for more information.
-); +) export const AlertBalanceTooLow = () => (
Balance too low - Your current Ethereum address does not contain enough ETH on - Ethereum Mainnet. You can add funds to your address using{" "} + Your current Ethereum address does not contain enough ETH on Ethereum Mainnet. You can add + funds to your address using{' '} + href="https://metamask.io/buy-crypto/"> MetaMask .
-); +) export const AlertCooldown = () => (
Cooldown period - You already got ETH from the faucet today. Try again in 24 hours.{" "} + You already got ETH from the faucet today. Try again in 24 hours.{' '} + href="https://support.metamask.io/"> Contact us .
-); +) export const AlertSuccess = ({ url }: { url: string }) => (
Transaction successful! - Your transaction has been sent to the Ethereum/Sepolia network. You - will receive your ETH shortly.{" "} + Your transaction has been sent to the Ethereum/Sepolia network. You will receive your ETH + shortly.{' '} + href={url}> View on Etherscan .
-); +) diff --git a/src/components/Faucet/index.tsx b/src/components/Faucet/index.tsx index 60292e3d455..3db1370a2ec 100644 --- a/src/components/Faucet/index.tsx +++ b/src/components/Faucet/index.tsx @@ -1,4 +1,10 @@ export { default as Faq } from './Faq' export { default as TransactionTable } from './TransactionTable' export { default as Hero } from './Hero' -export { AlertCommonIssue, AlertPastActivity, AlertCooldown, AlertSuccess } from './Alerts' +export { + AlertCommonIssue, + AlertPastActivity, + AlertCooldown, + AlertSuccess, + AlertFailedPoh, +} from './Alerts' diff --git a/src/pages/developer-tools/faucet.tsx b/src/pages/developer-tools/faucet.tsx index 7594a3b34f9..01890940a5e 100644 --- a/src/pages/developer-tools/faucet.tsx +++ b/src/pages/developer-tools/faucet.tsx @@ -12,6 +12,7 @@ import { TransactionTable, Hero, AlertPastActivity, + AlertFailedPoh, } from '@site/src/components/Faucet' import { useAlert } from 'react-alert' import { MetamaskProviderContext } from '@site/src/theme/Root' @@ -85,7 +86,9 @@ export default function Faucet() { const error = faucetResponse.error if (error) { - if (error.code === 'balance_too_low') { + if (error.code === 'failed_poh') { + alert.error() + } else if (error.code === 'balance_too_low') { alert.error() } else if (error.code === 'transaction_count_too_low') { alert.error()