File tree Expand file tree Collapse file tree 2 files changed +15
-22
lines changed
Expand file tree Collapse file tree 2 files changed +15
-22
lines changed Original file line number Diff line number Diff line change @@ -113,15 +113,15 @@ const PAGES = [
113113 } ,
114114 {
115115 path : "/faucet/calibnet_usdfc" ,
116- buttons : [ "Faucet List" , "Transaction History" , "Send " ] ,
116+ buttons : [ "Faucet List" , "Transaction History" , "Claim tUSDFC " ] ,
117117 } ,
118118 {
119119 path : "/faucet/calibnet" ,
120- buttons : [ "Faucet List" , "Transaction History" , "Send " ] ,
120+ buttons : [ "Faucet List" , "Transaction History" , "Claim tFIL " ] ,
121121 } ,
122122 {
123123 path : "/faucet/mainnet" ,
124- buttons : [ "Faucet List" , "Transaction History" , "Send " ] ,
124+ buttons : [ "Faucet List" , "Transaction History" , "Claim FIL " ] ,
125125 } ,
126126] ;
127127
Original file line number Diff line number Diff line change @@ -32,10 +32,11 @@ fn FaucetInput(faucet: RwSignal<FaucetController>) -> impl IntoView {
3232 class="input"
3333 />
3434 { move || {
35+ let unit = faucet. get( ) . get_unit( ) ;
3536 if faucet. get( ) . is_send_disabled( ) {
3637 view! {
3738 <button class="btn-disabled" disabled=true >
38- "Sending ..."
39+ "Claiming ..."
3940 </button>
4041 }
4142 . into_any( )
@@ -47,25 +48,17 @@ fn FaucetInput(faucet: RwSignal<FaucetController>) -> impl IntoView {
4748 </button>
4849 }
4950 . into_any( )
50- } else if faucet. get( ) . is_low_balance( ) {
51- view! {
52- <button class="btn-disabled" disabled=true >
53- "Send"
54- </button>
55- }
56- . into_any( )
5751 } else {
58- view! {
59- <button
60- class="btn-enabled"
61- on: click=move |_| {
62- faucet. get( ) . drip( ) ;
63- }
64- >
65- Send
66- </button>
67- }
68- . into_any( )
52+ let disabled = faucet. get( ) . is_low_balance( ) ;
53+ let btn_class = if disabled { "btn-disabled" } else { "btn-enabled" } ;
54+ let btn_props = if disabled {
55+ view! { <button class=btn_class disabled=true >{ format!( "Claim {unit}" ) } </button> }
56+ } else {
57+ view! {
58+ <button class=btn_class on: click=move |_| { faucet. get( ) . drip( ) ; } >{ format!( "Claim {unit}" ) } </button>
59+ }
60+ } ;
61+ btn_props. into_any( )
6962 }
7063 } }
7164 </div>
You can’t perform that action at this time.
0 commit comments