Skip to content

Commit

Permalink
foul explanation textbox only appears when foul is not set to None
Browse files Browse the repository at this point in the history
  • Loading branch information
SomewhatMay committed Mar 10, 2024
1 parent b41aada commit 0a086aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 7 additions & 1 deletion src/lib/components/FormFlow/Section.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<script lang="ts">
import type { Section } from "$lib/types";
import { activeResponses } from "$lib/store";
import Input from "./Input.svelte";
import { getContext } from "svelte";
export let section: Section;
export let errors: Record<string, string | undefined> = {};
const id: number = getContext("id");
</script>

<div class="flex flex-col">
<span class="text-xl font-bold mb-2 mt-1">{section.header}</span>
{#each section.inputs as input (input)}
<div>
<Input bind:error={errors[input.component.id]} {input} />
{#if !(input.component.id == "serious foul reason") || ($activeResponses[id].data["serious foul"] != "None")}
<Input bind:error={errors[input.component.id]} {input} />
{/if}
</div>
{/each}
</div>
Expand Down
8 changes: 0 additions & 8 deletions src/lib/components/FormFlow/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@

<div class="mt-5"></div>
{/each}
<!-- <button
class="rounded-md p-2 shadow-sm border-2 bg-error/50 border-error hover:bg-error/40 text-text/80"
on:click={() => submitResponse()} disabled={$errors[$response]}
>Submit</button>
<button
on:click={() => deleteResponse()}
class="rounded-md p-2 shadow-sm border-2 bg-success/50 border-success hover:bg-success/40 text-text/80 disabled:bg-success/10 disabled:border-success/20"
>Delete</button> -->
<div class="text-center">
<button
class="button clickable text-xl !px-5 !py-2 mr-3 !font-normal"
Expand Down

0 comments on commit 0a086aa

Please sign in to comment.