-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(site): simplify sepolia faucet button
- Loading branch information
Showing
2 changed files
with
10 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 9 additions & 26 deletions
35
site/src/routes/blog/start-of-the-endgame/SepoliaFaucetButton.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,17 @@ | ||
<script> | ||
import { ethereumAddress } from '$lib/stores/wallets' | ||
import { get } from "svelte/store"; | ||
import { ethereumAddress } from '$lib/stores/wallets' | ||
import TerminalContainer from "$lib/TerminalContainer.svelte"; | ||
import DemoButton from '$lib/DemoButton.svelte'; | ||
import DemoButtonA from '$lib/DemoButtonA.svelte'; | ||
let message = "Copy address"; | ||
const faucetAddress ="https://sepoliafaucet.com/" | ||
function copy() { | ||
let address = get(ethereumAddress); | ||
if (address == null) { | ||
return | ||
} | ||
navigator.clipboard.writeText(address); | ||
message = "Copied" | ||
} | ||
function goToFaucet() { | ||
window.open(faucetAddress, "_blank"); | ||
} | ||
</script> | ||
|
||
<TerminalContainer> | ||
{#if !$ethereumAddress == null} | ||
Connect Metamask to continue | ||
{:else} | ||
{#if !$ethereumAddress == null} | ||
<div>Complete the previous steps to continue</div> | ||
{:else} | ||
<div>Ethereum Address: <span class="text-accent">{$ethereumAddress}</span></div> | ||
<DemoButton on:click={copy}> | ||
{message} | ||
</DemoButton> | ||
<DemoButton on:click={goToFaucet}>Open Sepolia faucet</DemoButton> | ||
{/if} | ||
<div class="my-4"> | ||
<DemoButtonA href="https://sepoliafaucet.com/" target="_blank">Open Sepolia faucet</DemoButtonA> | ||
</div> | ||
{/if} | ||
</TerminalContainer> |