Skip to content

Commit

Permalink
add gui
Browse files Browse the repository at this point in the history
  • Loading branch information
hardingjam committed Jan 8, 2025
1 parent ce12d77 commit bcda981
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import TokenInputOrOutput from './TokenInputOrOutput.svelte';
import DropdownRadio from '../dropdown/DropdownRadio.svelte';
import { page } from '$app/stores';
import {
DotrainOrderGui,
type ApprovalCalldataResult,
Expand Down Expand Up @@ -46,6 +48,7 @@
let isLoading = false;
let error: DeploymentStepErrors | null = null;
let errorDetails: string | null = null;
let serializedGui: string | null = null;
async function loadStrategy() {
dotrain = testStrategy;
Expand Down Expand Up @@ -178,6 +181,8 @@
}
$: if (gui) {
console.log('GUI changed');
console.log(gui.serializeState());
error = null;
getTokenInfos();
getSelectTokens();
Expand Down Expand Up @@ -241,6 +246,8 @@
inputVaultIds = new Array(deployment.deployment.order.inputs.length).fill('');
outputVaultIds = new Array(deployment.deployment.order.outputs.length).fill('');
}
$: console.log('GUI:', gui);
</script>

<div class="mb-4">
Expand Down Expand Up @@ -284,21 +291,21 @@
<Label class="my-4 whitespace-nowrap text-2xl underline">Select Tokens</Label>

{#each selectTokens.entries() as [token]}
<SelectToken {token} {gui} bind:selectTokens />
<SelectToken {token} bind:gui bind:selectTokens />
{/each}
{/if}

{#if allFieldDefinitions.length > 0}
<Label class="my-4 whitespace-nowrap text-2xl underline">Field Values</Label>
{#each allFieldDefinitions as fieldDefinition}
<FieldDefinitionButtons {fieldDefinition} {gui} />
<FieldDefinitionButtons {fieldDefinition} bind:gui />
{/each}
{/if}

{#if allDeposits.length > 0}
<Label class="my-4 whitespace-nowrap text-2xl underline">Deposits</Label>
{#each allDeposits as deposit}
<DepositButtons bind:deposit {gui} bind:tokenInfos />
<DepositButtons bind:deposit bind:gui bind:tokenInfos />
{/each}
{/if}

Expand All @@ -311,7 +318,7 @@
vault={input}
{tokenInfos}
vaultIds={inputVaultIds}
{gui}
bind:gui
/>
{/each}
{/if}
Expand All @@ -325,7 +332,7 @@
vault={output}
{tokenInfos}
vaultIds={outputVaultIds}
{gui}
bind:gui
/>
{/each}
{/if}
Expand Down

0 comments on commit bcda981

Please sign in to comment.