Skip to content

Commit

Permalink
Move validation beneath
Browse files Browse the repository at this point in the history
Decided against this!
  • Loading branch information
backspace committed Dec 19, 2023
1 parent fc5b3ef commit 431e7e6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions gathering/app/components/labeled-input.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@ import { concat, hash } from '@ember/helper';

const LabeledInput = <template>
{{#let (if @errors 'red-500' 'black') as |colour|}}
<section class='block py-2' ...attributes>
<section class='block pt-2 {{if @errors '' 'pb-6'}}' ...attributes>
<div class='flex -mb-0.5'>
<label
for={{@label}}
class='border-2 border-{{colour}} bg-{{colour}} p-1 text-sm text-white'
>{{@label}}</label>
{{#if @errors}}
<span
class='border-2 border-white p-1 text-sm'
data-test-errors
>
{{#each @errors as |error|}}
{{error.key}}
{{/each}}
</span>
{{/if}}
</div>

{{yield
Expand All @@ -26,6 +16,16 @@ const LabeledInput = <template>
label=@label
)
}}
{{#if @errors}}
<span
class='border-2 border-transparent p-1 text-sm'
data-test-errors
>
{{#each @errors as |error|}}
{{error.key}}
{{/each}}
</span>
{{/if}}
</section>
{{/let}}
</template>;
Expand Down

0 comments on commit 431e7e6

Please sign in to comment.