Commit Graph

2 Commits

Author SHA1 Message Date
M. L. Giannotta 77c237d6a2 Storybook migration of `CountryInput` component (https://github.com/woocommerce/woocommerce-blocks/pull/5312)
* Enable `exactOptionalPropertyTypes` in TS config

This option will create more strict types out of optional properties.
Read more: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-beta/#exact-optional-property-types

* Extract `ComboBoxProps` as own interface

This way we can export it to use it somewhere else. In this specific case,
I'll need to use it as a base to extend the `CountryInputProps`.

Also fixed some types to be optional, as the component requires.

* Fix stories and props for `CountryInput` (https://github.com/woocommerce/woocommerce-blocks/pull/5252)
2021-12-07 16:07:21 +01:00
Thomas Roberts 995d6f0f82 Update `AddressForm` and related components to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/4365)
* Add type argument to getSetting

* Convert prepareAddressFields to TypeScript

* Add State and Country Input prop types

* Type country input

* Type state input

* Convert AddressForm to TypeScript

* Add SHIPPING_COUNTRIES, ALLOWED_COUNTRIES (and states) to constants.ts

* Add return types to components

* Remove shipping-country-input JS file

* Fix type of CountryInputWithCountriesProps

* Use type argument in constants.ts

* Remove unnecessary braces on onChange function

* Use correct case for allowedCountries
2021-06-17 09:35:24 +01:00