ordering-ui-react-native 0.18.53 → 0.18.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.18.53",
3
+ "version": "0.18.54",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -112,7 +112,7 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
112
112
  defaultCode={defaultCode ?
113
113
  !isNaN(defaultCode)
114
114
  ? transformCountryCode(defaultCode)
115
- : defaultCode
115
+ : findExitingCode(defaultCode)
116
116
  : findExitingCode(configs?.default_country_code?.value?.toUpperCase())}
117
117
  onChangeFormattedText={(text: string) => handleChangeNumber(text)}
118
118
  withDarkTheme
@@ -74,13 +74,22 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
74
74
  titleWrapStyle={{ paddingHorizontal: 0 }}
75
75
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
76
76
  />
77
- {order?.products?.map((product: any) => !product?.deleted && (
78
- <SingleProductReview
79
- key={product.id}
80
- product={product}
81
- formState={formState}
82
- handleChangeFormState={handleChangeFormState}
83
- />
77
+ {order?.products && order.products.length > 0 && order?.products.map(productsOrder => (
78
+ productsOrder?.length ? productsOrder?.map((product: any, i: any) => !product?.deleted ?
79
+ <SingleProductReview
80
+ key={i}
81
+ product={product}
82
+ formState={formState}
83
+ handleChangeFormState={handleChangeFormState}
84
+ /> : null
85
+ ) : (!productsOrder?.deleted ? (
86
+ <SingleProductReview
87
+ product={productsOrder}
88
+ formState={formState}
89
+ handleChangeFormState={handleChangeFormState}
90
+ />
91
+ ) : null
92
+ )
84
93
  ))}
85
94
  </ReviewProductsContainer>
86
95
 
@@ -273,7 +273,7 @@ export const transformCountryCode = (countryCode: number) => {
273
273
  }
274
274
 
275
275
  export const findExitingCode = (countryCode: string) => {
276
- const code = CODES.find((code: any) => code.countryCode === countryCode)
276
+ const code = CODES.find((code: any) => code.countryCode === (countryCode || '').toUpperCase())
277
277
  return code?.countryCode
278
278
  }
279
279