-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
web-wallet: Split transfer contract UI
Resolves #2175
- Loading branch information
1 parent
d889a9c
commit bdab0c6
Showing
10 changed files
with
124 additions
and
31 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
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
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
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
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
30 changes: 30 additions & 0 deletions
30
web-wallet/src/routes/(app)/dashboard/receive/+page.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<svelte:options immutable={true} /> | ||
|
||
<script> | ||
import { onDestroy, onMount } from "svelte"; | ||
import { TransferContract } from "$lib/containers"; | ||
import { IconHeadingCard } from "$lib/containers/Cards"; | ||
import { contractDescriptors, updateOperation } from "$lib/contracts"; | ||
import { operationsStore } from "$lib/stores"; | ||
import { mdiSwapVertical } from "@mdi/js"; | ||
onMount(() => { | ||
updateOperation("receive"); | ||
}) | ||
onDestroy(() => { | ||
updateOperation("receive"); | ||
}); | ||
</script> | ||
|
||
<IconHeadingCard | ||
gap="medium" | ||
heading="Transfer" | ||
iconPath={mdiSwapVertical} | ||
reverse | ||
> | ||
<TransferContract | ||
descriptor={contractDescriptors[1]} | ||
on:operationChange={({ detail }) => updateOperation(detail)} | ||
/> | ||
</IconHeadingCard> |
19 changes: 19 additions & 0 deletions
19
web-wallet/src/routes/(app)/dashboard/receive/__tests__/page.spec.js
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { afterEach, describe, expect, it, vi } from "vitest"; | ||
import { cleanup, render } from "@testing-library/svelte"; | ||
import Receive from "../+page.svelte"; | ||
|
||
vi.useFakeTimers(); | ||
|
||
describe("Receive", () => { | ||
afterEach(cleanup); | ||
|
||
// const currentPrice = Promise.resolve({ usd: 0.5 }); | ||
|
||
it("should render the receive page", async () => { | ||
const { container } = render(Receive); | ||
|
||
await vi.advanceTimersToNextTimerAsync(); | ||
|
||
expect(container.firstChild).toMatchSnapshot(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<svelte:options immutable={true} /> | ||
|
||
<script> | ||
import { onDestroy, onMount } from "svelte"; | ||
import { TransferContract } from "$lib/containers"; | ||
import { IconHeadingCard } from "$lib/containers/Cards"; | ||
import { contractDescriptors, updateOperation } from "$lib/contracts"; | ||
import { operationsStore } from "$lib/stores"; | ||
import { mdiSwapVertical } from "@mdi/js"; | ||
onMount(() => { | ||
updateOperation("send"); | ||
}) | ||
onDestroy(() => { | ||
updateOperation("send"); | ||
}); | ||
</script> | ||
|
||
<IconHeadingCard | ||
gap="medium" | ||
heading="Send" | ||
iconPath={mdiSwapVertical} | ||
reverse | ||
> | ||
<TransferContract | ||
descriptor={contractDescriptors[0]} | ||
on:operationChange={({ detail }) => updateOperation(detail)} | ||
/> | ||
</IconHeadingCard> |
19 changes: 19 additions & 0 deletions
19
web-wallet/src/routes/(app)/dashboard/send/__tests__/page.spec.js
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { afterEach, describe, expect, it, vi } from "vitest"; | ||
import { cleanup, render } from "@testing-library/svelte"; | ||
import Send from "../+page.svelte"; | ||
|
||
vi.useFakeTimers(); | ||
|
||
describe("Send", () => { | ||
afterEach(cleanup); | ||
|
||
// const currentPrice = Promise.resolve({ usd: 0.5 }); | ||
|
||
it("should render the send page", async () => { | ||
const { container } = render(Send); | ||
|
||
await vi.advanceTimersToNextTimerAsync(); | ||
|
||
expect(container.firstChild).toMatchSnapshot(); | ||
}); | ||
}); |
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