ordering-ui-react-native 0.18.53 → 0.18.55
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 +1 -1
- package/themes/original/src/components/LoginForm/index.tsx +5 -0
- package/themes/original/src/components/OrderProgress/index.tsx +1 -1
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/utils/index.tsx +6 -6
package/package.json
CHANGED
|
@@ -170,6 +170,10 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
170
170
|
vibrateApp()
|
|
171
171
|
return
|
|
172
172
|
}
|
|
173
|
+
if(!values?.cellphone && otpType === 'cellphone'){
|
|
174
|
+
showToast(ToastType.Error, t('PHONE_NUMBER_REQUIRED', 'Phone number is required'));
|
|
175
|
+
return
|
|
176
|
+
}
|
|
173
177
|
if (loginTab === 'otp') {
|
|
174
178
|
generateOtpCode({
|
|
175
179
|
...values,
|
|
@@ -253,6 +257,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
253
257
|
}
|
|
254
258
|
|
|
255
259
|
const handleLoginOtp = (code: string) => {
|
|
260
|
+
if (!code) return
|
|
256
261
|
handleButtonLoginClick({ code })
|
|
257
262
|
setWillVerifyOtpState(false)
|
|
258
263
|
}
|
|
@@ -152,7 +152,7 @@ const OrderProgressUI = (props: any) => {
|
|
|
152
152
|
</OrderInfoWrapper>
|
|
153
153
|
<View style={{ flex: 1 }}>
|
|
154
154
|
<ProgressContentWrapper>
|
|
155
|
-
<ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${getOrderStatus(lastOrder.status)
|
|
155
|
+
<ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${(getOrderStatus(lastOrder.status) as any).percentage * 100}%` : '0%' }} />
|
|
156
156
|
</ProgressContentWrapper>
|
|
157
157
|
<ProgressTextWrapper>
|
|
158
158
|
<OText size={12} style={{ width: '50%' }}>{getOrderStatus(lastOrder.status)?.value}</OText>
|
|
@@ -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
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
|
|
@@ -495,7 +495,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
495
495
|
'Order picked up completed by customer',
|
|
496
496
|
),
|
|
497
497
|
slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
498
|
-
percentage:
|
|
498
|
+
percentage: 1,
|
|
499
499
|
image: theme.images.order.status1,
|
|
500
500
|
},
|
|
501
501
|
{
|
|
@@ -542,7 +542,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
542
542
|
'Customer almost arrived to business',
|
|
543
543
|
),
|
|
544
544
|
slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
545
|
-
percentage:
|
|
545
|
+
percentage: 0.9,
|
|
546
546
|
image: theme.images.order.status7,
|
|
547
547
|
},
|
|
548
548
|
{
|
|
@@ -552,21 +552,21 @@ export const getOrderStatus = (s: string) => {
|
|
|
552
552
|
'Customer arrived to business',
|
|
553
553
|
),
|
|
554
554
|
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
555
|
-
percentage: 95,
|
|
555
|
+
percentage: 0.95,
|
|
556
556
|
image: theme.images.order.status7,
|
|
557
557
|
},
|
|
558
558
|
{
|
|
559
559
|
key: 22,
|
|
560
560
|
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
561
561
|
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
562
|
-
percentage: 35,
|
|
562
|
+
percentage: 0.35,
|
|
563
563
|
image: theme.images.order.status8
|
|
564
564
|
},
|
|
565
565
|
{
|
|
566
566
|
key: 23,
|
|
567
567
|
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
568
568
|
slug: 'ORDER_DRIVER_ON_WAY',
|
|
569
|
-
percentage: 45,
|
|
569
|
+
percentage: 0.45,
|
|
570
570
|
image: theme.images.order.status8
|
|
571
571
|
}
|
|
572
572
|
];
|