Skip to content

Commit ba34cbc

Browse files
authored
chore: cleanup faucet maintenance logic (#2037)
* chore: cleanup faucet maintenance logic * remove maintenance component export
1 parent b136e00 commit ba34cbc

File tree

4 files changed

+14
-69
lines changed

4 files changed

+14
-69
lines changed

src/components/Faucet/Hero.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface IHero {
1818
inputValue?: string
1919
isLoading?: boolean
2020
isLimitedUserPlan?: boolean
21+
isMaintenance?: boolean
2122
}
2223

2324
export default function Hero({
@@ -28,6 +29,7 @@ export default function Hero({
2829
handleOnInputChange,
2930
isLoading,
3031
isLimitedUserPlan,
32+
isMaintenance,
3133
}: IHero) {
3234
const {
3335
metaMaskAccount,
@@ -118,10 +120,12 @@ export default function Hero({
118120
: walletLinked === WALLET_LINK_TYPE.NO
119121
? 'Link your Developer Dashboard account to get started and request ETH.'
120122
: 'Select your Developer Dashboard account to get started and request ETH.'
121-
: 'Enter your MetaMask wallet address and request ETH.'}
123+
: !isMaintenance
124+
? 'Enter your MetaMask wallet address and request ETH.'
125+
: 'The faucet is at full capacity due to high demand. Try checking back later.'}
122126
</Text>
123127
<div className={styles.actions}>
124-
{!!Object.keys(projects).length && !showInstallButton && (
128+
{!!Object.keys(projects).length && !showInstallButton && !isMaintenance && (
125129
<div className={styles.inputCont}>
126130
<div className={styles.inputWrapper}>
127131
<Input

src/components/Faucet/Maintenance.tsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/components/Faucet/index.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
export { default as Faq } from "./Faq";
2-
export { default as TransactionTable } from "./TransactionTable";
3-
export { default as Hero } from "./Hero";
4-
export { default as Maintenance } from "./Maintenance";
5-
export {
6-
AlertCommonIssue,
7-
AlertPastActivity,
8-
AlertCooldown,
9-
AlertSuccess,
10-
} from "./Alerts";
1+
export { default as Faq } from './Faq'
2+
export { default as TransactionTable } from './TransactionTable'
3+
export { default as Hero } from './Hero'
4+
export { AlertCommonIssue, AlertPastActivity, AlertCooldown, AlertSuccess } from './Alerts'

src/pages/developer-tools/faucet.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
AlertSuccess,
1212
TransactionTable,
1313
Hero,
14-
Maintenance,
1514
AlertPastActivity,
1615
} from '@site/src/components/Faucet'
1716
import { useAlert } from 'react-alert'
@@ -168,7 +167,7 @@ export default function Faucet() {
168167
}
169168
}, [metaMaskAccount, metaMaskAccountEns])
170169

171-
const tabItemContent = (network: 'linea' | 'sepolia') => {
170+
const tabItemContent = (network: 'linea' | 'sepolia', isMaintenance: boolean) => {
172171
return (
173172
<>
174173
<div className={styles.topContent}>
@@ -180,6 +179,7 @@ export default function Faucet() {
180179
inputValue={walletAddress}
181180
isLoading={isLoading}
182181
isLimitedUserPlan={isLimitedUserPlan}
182+
isMaintenance={isMaintenance}
183183
/>
184184
{transactions && (
185185
<TransactionTable
@@ -205,12 +205,10 @@ export default function Faucet() {
205205
<div className={styles.tabs}>
206206
<Tabs className={styles.header}>
207207
<TabItem className={styles.content} value="sepolia" label="Ethereum Sepolia" default>
208-
{isSepoliaMaintenance && <Maintenance network="sepolia" />}
209-
{ldReady ? tabItemContent('sepolia') : null}
208+
{ldReady ? tabItemContent('sepolia', isSepoliaMaintenance) : null}
210209
</TabItem>
211210
<TabItem className={styles.content} value="linea" label="Linea Sepolia">
212-
{isLineaMaintenance && <Maintenance network="linea" />}
213-
{ldReady ? tabItemContent('linea') : null}
211+
{ldReady ? tabItemContent('linea', isLineaMaintenance) : null}
214212
</TabItem>
215213
</Tabs>
216214
</div>

0 commit comments

Comments
 (0)