diff --git a/app/src/lib/components/TransferFrom/components/AssetDialog.svelte b/app/src/lib/components/TransferFrom/components/AssetDialog.svelte new file mode 100644 index 0000000000..f0b418ecb0 --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/AssetDialog.svelte @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/components/ChainDialog.svelte b/app/src/lib/components/TransferFrom/components/ChainDialog.svelte new file mode 100644 index 0000000000..3cabf2c08c --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/ChainDialog.svelte @@ -0,0 +1,83 @@ + + +{#if dialogOpen && $context?.chains} + + + {/each} + + + + +{/if} + + \ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/components/Cube/FaceWrapper.svelte b/app/src/lib/components/TransferFrom/components/Cube/FaceWrapper.svelte new file mode 100644 index 0000000000..05e44ff759 --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/Cube/FaceWrapper.svelte @@ -0,0 +1,14 @@ + + +
+ +
diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte new file mode 100644 index 0000000000..d44299c058 --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte @@ -0,0 +1,23 @@ + + + \ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte new file mode 100644 index 0000000000..f83fdc7bc7 --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte @@ -0,0 +1,28 @@ + + +

Select chain

+{#each $context.chains as chain} + +{/each} \ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte new file mode 100644 index 0000000000..cb7b0ffabb --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte @@ -0,0 +1,87 @@ + + +
+
+ rotateTo("sourceFace")} + getDestinationChain={() => rotateTo("destinationFace")} + /> + rotateTo("assetsFace")} + /> +
+ intents.updateField('amount', event)} + /> + {#if $validation.errors.amount} + {$validation.errors.amount} + {/if} +
+ +
+ intents.updateField('receiver', event)} + /> + {#if $validation.errors.receiver} + {$validation.errors.receiver} + {/if} +
+
+ +
\ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte new file mode 100644 index 0000000000..0d0c0ee70e --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte @@ -0,0 +1,23 @@ + + + \ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/components/Cube/index.svelte b/app/src/lib/components/TransferFrom/components/Cube/index.svelte new file mode 100644 index 0000000000..c31e7a920d --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/Cube/index.svelte @@ -0,0 +1,98 @@ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + diff --git a/app/src/lib/components/TransferFrom/components/DebugBox.svelte b/app/src/lib/components/TransferFrom/components/DebugBox.svelte deleted file mode 100644 index 477fdb11fb..0000000000 --- a/app/src/lib/components/TransferFrom/components/DebugBox.svelte +++ /dev/null @@ -1,62 +0,0 @@ - - -
-
-
- - -
- -

TRANSFER DEBUG

- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
-
\ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/components/CollapsibleDisplay.svelte b/app/src/lib/components/TransferFrom/components/DebugBox/CollapsibleDisplay.svelte similarity index 100% rename from app/src/lib/components/TransferFrom/components/CollapsibleDisplay.svelte rename to app/src/lib/components/TransferFrom/components/DebugBox/CollapsibleDisplay.svelte diff --git a/app/src/lib/components/TransferFrom/components/CopyUrlButton.svelte b/app/src/lib/components/TransferFrom/components/DebugBox/CopyUrlButton.svelte similarity index 100% rename from app/src/lib/components/TransferFrom/components/CopyUrlButton.svelte rename to app/src/lib/components/TransferFrom/components/DebugBox/CopyUrlButton.svelte diff --git a/app/src/lib/components/TransferFrom/components/ResetButton.svelte b/app/src/lib/components/TransferFrom/components/DebugBox/ResetButton.svelte similarity index 100% rename from app/src/lib/components/TransferFrom/components/ResetButton.svelte rename to app/src/lib/components/TransferFrom/components/DebugBox/ResetButton.svelte diff --git a/app/src/lib/components/TransferFrom/components/DebugBox/index.svelte b/app/src/lib/components/TransferFrom/components/DebugBox/index.svelte new file mode 100644 index 0000000000..0798537de5 --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/DebugBox/index.svelte @@ -0,0 +1,78 @@ + + + + Debug + + +
+ + +
+
+ + +
+

TRANSFER DEBUG

+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ + + Close + +
+
\ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/components/Direction.svelte b/app/src/lib/components/TransferFrom/components/Direction.svelte new file mode 100644 index 0000000000..61c921544f --- /dev/null +++ b/app/src/lib/components/TransferFrom/components/Direction.svelte @@ -0,0 +1,39 @@ + + +
+ + +
diff --git a/app/src/lib/components/TransferFrom/index.svelte b/app/src/lib/components/TransferFrom/index.svelte index 75fd2ad8e6..e799bdc15d 100644 --- a/app/src/lib/components/TransferFrom/index.svelte +++ b/app/src/lib/components/TransferFrom/index.svelte @@ -1,122 +1,40 @@ -
-
-
- - intents.updateField('source', event)} - /> - {#if $validation.errors.source} - {$validation.errors.source} - {/if} -
+ +
+ +
-
- - intents.updateField('destination', event)} - /> - {#if $validation.errors.destination} - {$validation.errors.destination} - {/if} -
+
+ +
-
- - intents.updateField('asset', event)} - /> - {#if $validation.errors.asset} - {$validation.errors.asset} - {/if} -
+
+ +
-
- - intents.updateField('amount', event)} - /> - {#if $validation.errors.amount} - {$validation.errors.amount} - {/if} -
+
+ +
-
- - intents.updateField('receiver', event)} - /> - {#if $validation.errors.receiver} - {$validation.errors.receiver} - {/if} -
+
+
- +
-{#if TRANSFER_DEBUG} - -{/if} \ No newline at end of file +
+ {#if TRANSFER_DEBUG} + + {/if} +
diff --git a/app/src/lib/components/TransferFrom/config.ts b/app/src/lib/components/TransferFrom/transfer/config.ts similarity index 100% rename from app/src/lib/components/TransferFrom/config.ts rename to app/src/lib/components/TransferFrom/transfer/config.ts diff --git a/app/src/lib/components/TransferFrom/transfer/index.ts b/app/src/lib/components/TransferFrom/transfer/index.ts index c0b2731e97..15db72c431 100644 --- a/app/src/lib/components/TransferFrom/transfer/index.ts +++ b/app/src/lib/components/TransferFrom/transfer/index.ts @@ -1,9 +1,7 @@ import { type Readable } from "svelte/store" import { createIntentStore, type IntentStore } from "./intents.ts" import { type ContextStore, createContextStore} from "$lib/components/TransferFrom/transfer/context.ts" -import { - createValidationStore, type ValidationStoreAndMethods -} from "$lib/components/TransferFrom/transfer/validation.ts" +import { createValidationStore, type ValidationStoreAndMethods } from "$lib/components/TransferFrom/transfer/validation.ts" export interface TransferStore { intents: IntentStore diff --git a/app/src/lib/components/TransferFrom/transfer/intents.ts b/app/src/lib/components/TransferFrom/transfer/intents.ts index 8b536fcd3a..3b37fdac30 100644 --- a/app/src/lib/components/TransferFrom/transfer/intents.ts +++ b/app/src/lib/components/TransferFrom/transfer/intents.ts @@ -2,7 +2,7 @@ import { writable } from "svelte/store" import { browser } from "$app/environment" import { page } from "$app/stores" import { debounce } from "$lib/utilities" -import { defaultParams } from "$lib/components/TransferFrom/config.ts" +import { defaultParams } from "$lib/components/TransferFrom/transfer/config.ts" export type FormFields = { source: string diff --git a/app/src/lib/components/TransferFrom/transfer/validation.ts b/app/src/lib/components/TransferFrom/transfer/validation.ts index e9451dfe06..684086b4b6 100644 --- a/app/src/lib/components/TransferFrom/transfer/validation.ts +++ b/app/src/lib/components/TransferFrom/transfer/validation.ts @@ -111,6 +111,7 @@ export function createValidationStore( } const errors: FieldErrors = {} + //Example if (formFields.source && formFields.destination && formFields.source === formFields.destination) { errors.destination = "Source and destination chains must be different" } diff --git a/app/src/lib/components/TransferFrom/types.ts b/app/src/lib/components/TransferFrom/types.ts new file mode 100644 index 0000000000..397e5eb703 --- /dev/null +++ b/app/src/lib/components/TransferFrom/types.ts @@ -0,0 +1,7 @@ +export type CubeFaces = + 'intentFace' | + 'chainsFace' | + 'verifyFace' | + 'assetsFace' | + "sourceFace" | + "destinationFace" \ No newline at end of file diff --git a/app/src/routes/transfer/+page.svelte b/app/src/routes/transfer/+page.svelte index f2bbe1a487..a4f16c8e8e 100644 --- a/app/src/routes/transfer/+page.svelte +++ b/app/src/routes/transfer/+page.svelte @@ -7,8 +7,8 @@ import TransferFrom from "$lib/components/TransferFrom/index.svelte" Union | Send - -
- + +
+