Skip to content

Commit 6330c3e

Browse files
authored
feat: separate calibnet and mainnet (#92)
1 parent 9613544 commit 6330c3e

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/app.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ pub fn Faucet(target_network: Network) -> impl IntoView {
217217
view! {}.into_view()
218218
}
219219
}}
220-
<h1 class="text-4xl font-bold mb-6 text-center">Faucet</h1>
221-
222220
<div class="max-w-2xl mx-auto">
223221
<div class="my-4 flex">
224222
<input
@@ -361,10 +359,30 @@ pub fn Faucet(target_network: Network) -> impl IntoView {
361359
pub fn Faucets() -> impl IntoView {
362360
view! {
363361
<div>
364-
<h2 class="text-2xl font-bold mb-4">Calibration Network Faucet</h2>
362+
<h2 class="text-2xl font-bold mb-4">Faucet List</h2>
363+
<ul class="list-disc pl-5">
364+
<li><a class="text-blue-600" href="/faucet/calibnet">Calibration Network Faucet</a></li>
365+
<li><a class="text-blue-600" href="/faucet/mainnet">Mainnet Network Faucet</a></li>
366+
</ul>
367+
</div>
368+
}
369+
}
370+
371+
#[component]
372+
pub fn Faucet_Calibnet() -> impl IntoView {
373+
view! {
374+
<div>
375+
<h1 class="text-4xl font-bold mb-6 text-center">Calibnet Faucet</h1>
365376
<Faucet target_network=Network::Testnet />
377+
</div>
378+
}
379+
}
366380

367-
<h2 class="text-2xl font-bold mb-4 mt-8">Mainnet Network Faucet</h2>
381+
#[component]
382+
pub fn Faucet_Mainnet() -> impl IntoView {
383+
view! {
384+
<div>
385+
<h1 class="text-4xl font-bold mb-6 text-center">Mainnet Faucet</h1>
368386
<Faucet target_network=Network::Mainnet />
369387
</div>
370388
}
@@ -382,6 +400,8 @@ pub fn App() -> impl IntoView {
382400
<Routes>
383401
<Route path="/" view=BlockchainExplorer />
384402
<Route path="/faucet" view=Faucets />
403+
<Route path="/faucet/calibnet" view=Faucet_Calibnet />
404+
<Route path="/faucet/mainnet" view=Faucet_Mainnet />
385405
</Routes>
386406
</Router>
387407
}

0 commit comments

Comments
 (0)