Skip to content

Commit

Permalink
Add the rendering of validation errors to ShippingTimeSetup
Browse files Browse the repository at this point in the history
  • Loading branch information
eason9487 committed Jul 20, 2023
1 parent 28aad98 commit 6d389a1
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ import ShippingCountriesForm from './countries-form';
* Form control to edit shipping rate settings.
*/
const ShippingTimeSetup = () => {
const { getInputProps, adapter } = useAdaptiveFormContext();
const {
getInputProps,
adapter: { audienceCountries, renderRequestedValidation },
} = useAdaptiveFormContext();

if ( ! adapter.audienceCountries ) {
if ( ! audienceCountries ) {
return <AppSpinner />;
}

Expand All @@ -32,8 +35,9 @@ const ShippingTimeSetup = () => {
</Section.Card.Title>
<ShippingCountriesForm
{ ...getInputProps( 'shipping_country_times' ) }
audienceCountries={ adapter.audienceCountries }
audienceCountries={ audienceCountries }
/>
{ renderRequestedValidation( 'shipping_country_times' ) }
</Section.Card.Body>
</Section.Card>
);
Expand Down

0 comments on commit 6d389a1

Please sign in to comment.