Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit 3506692

Browse files
committed
fix(app-contact): fix to passed state check
1 parent a0ea00f commit 3506692

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/components/app-input/app-input.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.fa-check {
2+
display: none;
3+
}
4+
15
.valid {
26
position: relative;
37

@@ -10,11 +14,12 @@
1014
border: $green 1px solid;
1115
}
1216

13-
svg {
17+
.fa-check {
1418
position: absolute;
1519
bottom: 7px;
1620
right: 5px;
1721
transform: translate(-50%, -50%);
1822
color: $green;
23+
display: block;
1924
}
2025
}

src/components/app-input/app-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class AppInput {
4646
placeholder={this.placeholder}
4747
onInput={this.inputHandler.bind(this)}
4848
/>
49-
{this.valid ? <i class="fas fa-check" /> : null}
49+
<i class="fas fa-check" />
5050
</div>
5151
);
5252
}

src/pages/app-contact/app-contact.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class AppContact {
142142
id="name"
143143
placeholder={translate('contact.form.placeholder.name')}
144144
required={true}
145-
valid={this.formValues.nameValid}
145+
valid={this.formValues && this.formValues.nameValid}
146146
/>
147147
<p class="error">
148148
<span style={!this.nameError ? { display: 'none' } : this.errorIconStyles}>
@@ -158,7 +158,7 @@ export class AppContact {
158158
id="email"
159159
placeholder={translate('contact.form.placeholder.email')}
160160
required={true}
161-
valid={this.formValues.emailValid}
161+
valid={this.formValues && this.formValues.emailValid}
162162
/>
163163
<p class="error">
164164
<span style={!this.emailError ? { display: 'none' } : this.errorIconStyles}>
@@ -174,7 +174,7 @@ export class AppContact {
174174
type="tel"
175175
placeholder={translate('contact.form.placeholder.phone')}
176176
required={false}
177-
valid={this.formValues.phoneValid}
177+
valid={this.formValues && this.formValues.phoneValid}
178178
/>
179179
<p class="error">
180180
<span style={!this.phoneError ? { display: 'none' } : this.errorIconStyles}>
@@ -189,7 +189,7 @@ export class AppContact {
189189
type="text"
190190
placeholder={translate('contact.form.placeholder.message')}
191191
required={false}
192-
valid={this.formValues.messageValid}
192+
valid={this.formValues && this.formValues.messageValid}
193193
/>
194194
<p class="error">
195195
<span style={!this.messageError ? { display: 'none' } : this.errorIconStyles}>

0 commit comments

Comments
 (0)