From c88a74f0d734fb349e2257efb005f8ee991c58f7 Mon Sep 17 00:00:00 2001 From: sudo-shashank Date: Mon, 3 Feb 2025 18:55:11 +0530 Subject: [PATCH 1/6] Add faucet topup link --- src/faucet/views.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/faucet/views.rs b/src/faucet/views.rs index 1e79eb0..32a21a8 100644 --- a/src/faucet/views.rs +++ b/src/faucet/views.rs @@ -13,6 +13,7 @@ use leptos_use::*; use crate::faucet::controller::FaucetController; use crate::faucet::utils::format_balance; +const FAUCET_TOPUP_REQ_URL: &str = "https://github.com/ChainSafe/forest-explorer/discussions/134"; const MESSAGE_FADE_AFTER: Duration = Duration::new(3, 0); const MESSAGE_REMOVAL_AFTER: Duration = Duration::new(3, 500_000_000); @@ -40,7 +41,10 @@ pub fn Faucet(target_network: Network) -> impl IntoView { ); let (fading_messages, set_fading_messages) = signal(HashSet::new()); - + let drip_amount = match target_network { + Network::Mainnet => crate::constants::MAINNET_DRIP_AMOUNT.clone(), + Network::Testnet => crate::constants::CALIBNET_DRIP_AMOUNT.clone(), + }; view! { {move || { let errors = faucet.get().get_error_messages(); @@ -137,6 +141,12 @@ pub fn Faucet(target_network: Network) -> impl IntoView { {format!("Rate-limited! {duration}s")} }.into_any() + } else if faucet.get().get_faucet_balance() < drip_amount { + view! { + + "Request Faucet Top-up" + + }.into_any() } else { view! {