-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scheme name (required) to the details form and adjust some questions
- Loading branch information
1 parent
a2bc97e
commit 28fa598
Showing
3 changed files
with
63 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
<script lang="ts"> | ||
import ErrorMessage from "./ErrorMessage.svelte"; | ||
import FormElement from "./FormElement.svelte"; | ||
export let label: string; | ||
export let value: string | undefined; | ||
// Show an error if input is empty | ||
export let required = false; | ||
// TODO Using the label as a unique ID, so users don't have to invent an arbitrary string | ||
$: errorMessage = | ||
required && (value == undefined || value == "") ? "Required" : ""; | ||
</script> | ||
|
||
<FormElement {label} id={label}> | ||
<ErrorMessage {errorMessage} /> | ||
<input type="text" class="govuk-input" id={label} bind:value /> | ||
</FormElement> |
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