diff --git a/src/OAP/Oap.Theme.Svelte/index.html b/src/OAP/Oap.Theme.Svelte/index.html index 8c4957b..b754e27 100644 --- a/src/OAP/Oap.Theme.Svelte/index.html +++ b/src/OAP/Oap.Theme.Svelte/index.html @@ -9,6 +9,7 @@
+
import { Client, setContextClient, queryStore } from "@urql/svelte"; - import OapApplicationFormStep from "./components/OapApplicationFormStep.svelte"; import { graphql } from "./gql"; + import OapApplicationFormStep from "./components/OapApplicationFormStep.svelte"; + import step from "./lib/stores/step"; + export let antiForgeryToken: string | null; export let contentItemId: string; export let client: Client; @@ -30,6 +32,10 @@ contentItemId, }, }); + + function handleSubmit(event: SubmitEvent) { + step.update(x => x + 1); + } {#if $content.fetching} @@ -48,13 +54,14 @@ {oapApplicationForm.displayText} {/if} - {#if oapApplicationForm?.list} - {#each oapApplicationForm.list.contentItems ?? [] as contentItem} - {#if contentItem?.__typename === "OapApplicationFormStep"} - - {/if} - {/each} - {/if} + {#each oapApplicationForm?.list?.contentItems ?? [] as contentItem, index} + {#if contentItem?.__typename === "OapApplicationFormStep" && $step === index} + + {/if} + {/each} {/each}
{/if} diff --git a/src/OAP/Oap.Theme.Svelte/src/components/Form.svelte b/src/OAP/Oap.Theme.Svelte/src/components/Form.svelte index 3a93983..f195a77 100644 --- a/src/OAP/Oap.Theme.Svelte/src/components/Form.svelte +++ b/src/OAP/Oap.Theme.Svelte/src/components/Form.svelte @@ -1,4 +1,5 @@ - - - -
+ + + + Overseas Auto Protection - Svelte + + + + +
-
+
+
+
- +