Skip to content

Commit

Permalink
Set paseo as default network (#426)
Browse files Browse the repository at this point in the history
Resolves #424

I also added a new header text as requested by @lovelaced
  • Loading branch information
Bullrich authored Jun 24, 2024
1 parent b0e4a7b commit 5691ecb
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
4 changes: 3 additions & 1 deletion client/src/lib/components/Card.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<script lang="ts">
import { PUBLIC_DEMO_MODE } from "$env/static/public";
import { testnet } from "$lib/utils/stores";
export let title: string;
</script>

<div class="card md:w-2/4 w-5/6 min-w-full shadow-xl faucet-card">
<div class="card-body items-center text-center">
<h1 class="card-title">{$testnet.networkName} Faucet</h1>
<h3 class="card-subtitle">
Get {$testnet.currency} tokens for Polkadot's {$testnet.networkName} testnet and its parachains.
{title}
</h3>
<div class="mt-2 md:mt-8 w-full">
<slot />
Expand Down
3 changes: 2 additions & 1 deletion client/src/lib/components/Faucet.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
export let faq: string;
export let network: NetworkData;
export let title: string = `Get ${network.currency} tokens for Polkadot's ${network.networkName} testnet and its parachains.`;
let parachain: number;
onMount(() => {
Expand All @@ -29,7 +30,7 @@
<SocialTags />
<MarkUp {faq} />
<div class="flex items-center justify-center mt-16 mb-4 md:my-16">
<Card>
<Card {title}>
{#if !$operation}
<Form network={parachain ?? -1} networkData={network} />
{:else}
Expand Down
4 changes: 2 additions & 2 deletions client/src/lib/utils/networkData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export const Paseo: NetworkData = {
};

export const Networks: { network: NetworkData; url: string }[] = [
{ network: Rococo, url: (base as string) || "/" },
{ network: Paseo, url: `${base as string}/paseo` },
{ network: Paseo, url: (base as string) || "/" },
{ network: Rococo, url: `${base as string}/rococo` },
{ network: Westend, url: `${base as string}/westend` },
];

Expand Down
8 changes: 5 additions & 3 deletions client/src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<script lang="ts">
import faqMd from "$lib/assets/FAQ.md?raw";
import Faucet from "$lib/components/Faucet.svelte";
import { type NetworkData, Rococo } from "$lib/utils/networkData";
import { type NetworkData, Paseo } from "$lib/utils/networkData";
let network: NetworkData = Rococo;
let network: NetworkData = Paseo;
let faq: string = faqMd
.replaceAll("<NETWORK-TOKEN>", network.currency)
.replaceAll("<NETWORK-NAME>", network.networkName);
const title = `Get ${network.currency} tokens for Polkadot's ${network.networkName} testnet and its parachains. Paseo is Polkadot's primary testnet for users and builders.`;
</script>

<Faucet {network} {faq} />
<Faucet {network} {faq} {title} />
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import faqMd from "$lib/assets/FAQ.md?raw";
import Faucet from "$lib/components/Faucet.svelte";
import { type NetworkData, Paseo } from "$lib/utils/networkData";
import { type NetworkData, Rococo } from "$lib/utils/networkData";
let network: NetworkData = Paseo;
let network: NetworkData = Rococo;
let faq: string = faqMd
.replaceAll("<NETWORK-TOKEN>", network.currency)
.replaceAll("<NETWORK-NAME>", network.networkName);
Expand Down
2 changes: 1 addition & 1 deletion client/tests/paseo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { FaucetTests } from "./faucet.js";

const chains = [{ name: "Paseo Relay", id: -1 }];

const tests = new FaucetTests({ faucetName: "Paseo Faucet", chains, url: "/paseo", expectTransactionLink: false });
const tests = new FaucetTests({ faucetName: "Paseo Faucet", chains, url: "/", expectTransactionLink: false });
tests.runTests();
2 changes: 1 addition & 1 deletion client/tests/rococo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ const chains = [
{ name: "Bridgehub", id: 1013 },
];

const tests = new FaucetTests({ faucetName: "Rococo Faucet", chains, url: "/", expectTransactionLink: true });
const tests = new FaucetTests({ faucetName: "Rococo Faucet", chains, url: "/rococo", expectTransactionLink: true });
tests.runTests();
3 changes: 2 additions & 1 deletion client/tests/switch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { expect, test } from "@playwright/test";
type Network = { name: string; url: string };

export const networks: Network[] = [
{ name: "Rococo", url: "/" },
{ name: "Paseo", url: "/" },
{ name: "Rococo", url: "/rococo" },
{ name: "Westend", url: "/westend" },
];

Expand Down

0 comments on commit 5691ecb

Please sign in to comment.