Add custom error for store details email and allow continue (https://github.com/woocommerce/woocommerce-admin/pull/8110)
* Add custom error for store details email and allow continue * Add changelog entry
This commit is contained in:
parent
48c2742099
commit
2dde3f5fa4
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: Update
|
||||||
|
|
||||||
|
Add custom error for store details email and allow continue #8110
|
|
@ -200,15 +200,6 @@ class StoreDetails extends Component {
|
||||||
validateStoreDetails( values ) {
|
validateStoreDetails( values ) {
|
||||||
const errors = validateStoreAddress( values );
|
const errors = validateStoreAddress( values );
|
||||||
|
|
||||||
if (
|
|
||||||
values.isAgreeMarketing &&
|
|
||||||
( ! values.storeEmail || ! values.storeEmail.trim().length )
|
|
||||||
) {
|
|
||||||
errors.storeEmail = __(
|
|
||||||
'Please add an email address',
|
|
||||||
'woocommerce-admin'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
values.storeEmail &&
|
values.storeEmail &&
|
||||||
values.storeEmail.trim().length &&
|
values.storeEmail.trim().length &&
|
||||||
|
@ -342,14 +333,31 @@ class StoreDetails extends Component {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextControl
|
<TextControl
|
||||||
label={ __(
|
label={
|
||||||
|
values.isAgreeMarketing
|
||||||
|
? __(
|
||||||
'Email address',
|
'Email address',
|
||||||
'woocommerce-admin'
|
'woocommerce-admin'
|
||||||
) }
|
)
|
||||||
required
|
: __(
|
||||||
|
'Email address (Optional)',
|
||||||
|
'woocommerce-admin'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
required={ values.isAgreeMarketing }
|
||||||
autoComplete="email"
|
autoComplete="email"
|
||||||
{ ...getInputProps( 'storeEmail' ) }
|
{ ...getInputProps( 'storeEmail' ) }
|
||||||
/>
|
/>
|
||||||
|
{ values.isAgreeMarketing &&
|
||||||
|
( ! values.storeEmail ||
|
||||||
|
! values.storeEmail.trim().length ) && (
|
||||||
|
<div className="woocommerce-profile-wizard__store-details-error">
|
||||||
|
{ __(
|
||||||
|
'Please enter your email address to subscribe',
|
||||||
|
'woocommerce-admin'
|
||||||
|
) }
|
||||||
|
</div>
|
||||||
|
) }
|
||||||
</CardBody>
|
</CardBody>
|
||||||
|
|
||||||
<CardFooter>
|
<CardFooter>
|
||||||
|
|
|
@ -19,3 +19,11 @@
|
||||||
color: $studio-gray-20;
|
color: $studio-gray-20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.woocommerce-profile-wizard__store-details-error {
|
||||||
|
margin-top: -$gap-small;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
color: #d63638;
|
||||||
|
padding-left: $gap-small;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue