ordering-ui-react-native 0.22.52 → 0.22.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 +1 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +1 -1
- package/themes/original/src/components/AddressForm/index.tsx +0 -11
- package/themes/original/src/components/AddressList/index.tsx +0 -13
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +4 -2
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +14 -17
- package/themes/original/src/components/Cart/index.tsx +1 -2
- package/themes/original/src/components/CartContent/index.tsx +1 -2
- package/themes/original/src/components/Checkout/index.tsx +10 -13
- package/themes/original/src/components/CitiesControl/index.tsx +0 -3
- package/themes/original/src/components/CouponControl/index.tsx +1 -3
- package/themes/original/src/components/DriverTips/index.tsx +1 -3
- package/themes/original/src/components/Favorite/index.tsx +0 -5
- package/themes/original/src/components/FavoriteList/index.tsx +0 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +4 -10
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
- package/themes/original/src/components/Help/index.tsx +0 -5
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +0 -5
- package/themes/original/src/components/HelpGuide/index.tsx +0 -5
- package/themes/original/src/components/HelpOrder/index.tsx +0 -5
- package/themes/original/src/components/Home/index.tsx +0 -3
- package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
- package/themes/original/src/components/LoginForm/index.tsx +0 -9
- package/themes/original/src/components/MessageListing/index.tsx +0 -5
- package/themes/original/src/components/MomentOption/index.tsx +1 -8
- package/themes/original/src/components/MultiCheckout/index.tsx +0 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
- package/themes/original/src/components/MyOrders/index.tsx +0 -5
- package/themes/original/src/components/NavBar/index.tsx +1 -4
- package/themes/original/src/components/NetworkError/index.tsx +0 -5
- package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
- package/themes/original/src/components/Notifications/index.tsx +0 -5
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +5 -7
- package/themes/original/src/components/OrderDetails/index.tsx +0 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +3 -8
- package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
- package/themes/original/src/components/PaymentOptions/index.tsx +0 -2
- package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -4
- package/themes/original/src/components/ProductForm/ActionButton.tsx +4 -5
- package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
- package/themes/original/src/components/Promotions/index.tsx +2 -7
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -7
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -6
- package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/index.tsx +52 -54
- package/themes/original/src/components/Sessions/index.tsx +3 -8
- package/themes/original/src/components/SignupForm/index.tsx +3 -13
- package/themes/original/src/components/SingleOrderCard/index.tsx +0 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
- package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
- package/themes/original/src/components/StripeElementsForm/index.tsx +0 -1
- package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +1 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +8 -10
- package/themes/original/src/components/UserProfileForm/index.tsx +0 -5
- package/themes/original/src/components/Wallets/index.tsx +1 -3
- package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
- package/themes/original/src/components/shared/OButton.tsx +3 -2
package/package.json
CHANGED
|
@@ -156,7 +156,7 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
156
156
|
setCurrentEvent({ evt: 2, orderId: value?.id ?? value?.order_id })
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
if (!orderStatus.includes(value.status) || value?.author_id === user.id) return
|
|
159
|
+
if ((!orderStatus.includes(value.status) && evtType !== 1) || value?.author_id === user.id) return
|
|
160
160
|
setCurrentEvent({
|
|
161
161
|
evt: evtType,
|
|
162
162
|
orderId: value?.driver
|
|
@@ -542,11 +542,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
542
542
|
style={{ marginTop: Platform.OS === 'ios' ? 0 : 10 }}
|
|
543
543
|
titleWrapStyle={{ paddingHorizontal: 0, width: '100%' }}
|
|
544
544
|
titleStyle={{ marginRight: 0, marginLeft: 0, paddingRight: 5 }}
|
|
545
|
-
buttonProps={{
|
|
546
|
-
bgColor: theme.colors.white,
|
|
547
|
-
borderColor: theme.colors.white,
|
|
548
|
-
textStyle: { color: theme.colors.btnFont }
|
|
549
|
-
}}
|
|
550
545
|
/>
|
|
551
546
|
</View>
|
|
552
547
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
|
@@ -857,9 +852,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
857
852
|
: t('LOADING', 'Loading')
|
|
858
853
|
}
|
|
859
854
|
onClick={handleSubmit(onSubmit)}
|
|
860
|
-
bgColor={theme.colors.primary}
|
|
861
|
-
borderColor={theme.colors.primary}
|
|
862
|
-
textStyle={{ color: theme.colors.white }}
|
|
863
855
|
isDisabled={formState.loading}
|
|
864
856
|
style={{ borderRadius: 7.6, shadowOpacity: 0 }}
|
|
865
857
|
showNextIcon
|
|
@@ -895,9 +887,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
895
887
|
)}
|
|
896
888
|
<OButton
|
|
897
889
|
text={t('SAVE', 'Save')}
|
|
898
|
-
textStyle={{ color: theme.colors.white }}
|
|
899
|
-
bgColor={theme.colors.primary}
|
|
900
|
-
borderColor={theme.colors.primary}
|
|
901
890
|
imgRightSrc={null}
|
|
902
891
|
style={{ marginHorizontal: 30, marginBottom: 10 }}
|
|
903
892
|
onClick={() => setSaveMapLocation(true)}
|
|
@@ -152,11 +152,6 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
152
152
|
showCall={false}
|
|
153
153
|
paddingTop={10}
|
|
154
154
|
btnStyle={{ paddingLeft: 0 }}
|
|
155
|
-
buttonProps={{
|
|
156
|
-
bgColor: theme.colors.white,
|
|
157
|
-
borderColor: theme.colors.white,
|
|
158
|
-
textStyle: { color: theme.colors.btnFont }
|
|
159
|
-
}}
|
|
160
155
|
/>
|
|
161
156
|
)}
|
|
162
157
|
{
|
|
@@ -178,11 +173,6 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
178
173
|
style={{ marginTop: 0 }}
|
|
179
174
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
180
175
|
titleStyle={{ marginLeft: 0, marginRight: 0 }}
|
|
181
|
-
buttonProps={{
|
|
182
|
-
bgColor: theme.colors.white,
|
|
183
|
-
borderColor: theme.colors.white,
|
|
184
|
-
textStyle: { color: theme.colors.btnFont }
|
|
185
|
-
}}
|
|
186
176
|
/>
|
|
187
177
|
)}
|
|
188
178
|
{addressList.loading && addressList?.addresses?.length === 0 && (
|
|
@@ -305,10 +295,7 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
305
295
|
<OButton
|
|
306
296
|
text={t('ADD_NEW_ADDRESS', 'Add new Address')}
|
|
307
297
|
imgRightSrc=''
|
|
308
|
-
bgColor={theme.colors.primary}
|
|
309
|
-
textStyle={{ color: theme.colors.white }}
|
|
310
298
|
style={styles.button}
|
|
311
|
-
borderColor={theme.colors.primary}
|
|
312
299
|
onClick={() => !afterSignup ? onNavigationRedirect(
|
|
313
300
|
'AddressForm',
|
|
314
301
|
{
|
|
@@ -57,6 +57,8 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
57
57
|
return acc = acc
|
|
58
58
|
}, cart?.subtotal)
|
|
59
59
|
|
|
60
|
+
const bgStyle = (subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary
|
|
61
|
+
|
|
60
62
|
useEffect(() => {
|
|
61
63
|
if (isActive && !isFromUpselling) {
|
|
62
64
|
if (cart?.uuid !== viewedCart?.uuid) {
|
|
@@ -156,8 +158,8 @@ export const BusinessItemAccordion = (props: any) => {
|
|
|
156
158
|
textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
|
|
157
159
|
style={{ width: 180, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
158
160
|
text={t('CHECKOUT', 'Checkout')}
|
|
159
|
-
bgColor={
|
|
160
|
-
borderColor={
|
|
161
|
+
bgColor={bgStyle}
|
|
162
|
+
borderColor={bgStyle}
|
|
161
163
|
isDisabled={checkoutButtonDisabled}
|
|
162
164
|
/>
|
|
163
165
|
)}
|
|
@@ -47,13 +47,11 @@ export const BusinessSearchHeader = (props: any) => {
|
|
|
47
47
|
borderWidth: 0,
|
|
48
48
|
width: 26,
|
|
49
49
|
height: 26,
|
|
50
|
-
backgroundColor: '#FFF',
|
|
51
|
-
borderColor: '#FFF',
|
|
52
|
-
shadowColor: '#FFF',
|
|
53
50
|
paddingLeft: 0,
|
|
54
51
|
paddingRight: 0,
|
|
55
52
|
marginTop: 50,
|
|
56
53
|
}}
|
|
54
|
+
useArrow
|
|
57
55
|
onClick={() => props.navigation.goBack()}
|
|
58
56
|
icon={AntDesignIcon}
|
|
59
57
|
iconProps={{
|
|
@@ -230,7 +230,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
230
230
|
</BusinessInfoItem>
|
|
231
231
|
<OButton
|
|
232
232
|
onClick={() => onBusinessClick(business)}
|
|
233
|
-
textStyle={{
|
|
233
|
+
textStyle={{ fontSize: 10 }}
|
|
234
234
|
text={t('GO_TO_STORE', 'Go to store')}
|
|
235
235
|
style={{
|
|
236
236
|
borderRadius: 23,
|
|
@@ -238,7 +238,6 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
238
238
|
paddingRight: 10,
|
|
239
239
|
height: 23,
|
|
240
240
|
shadowOpacity: 0,
|
|
241
|
-
backgroundColor: theme.colors.primaryContrast,
|
|
242
241
|
borderWidth: 0
|
|
243
242
|
}}
|
|
244
243
|
/>
|
|
@@ -527,9 +527,6 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
527
527
|
)}
|
|
528
528
|
<OButton
|
|
529
529
|
text={t('GO_TO_MENU', 'Go to menu')}
|
|
530
|
-
textStyle={{ color: 'white' }}
|
|
531
|
-
bgColor={theme.colors.primary}
|
|
532
|
-
borderColor={theme.colors.primary}
|
|
533
530
|
style={{ borderRadius: 7.6, marginBottom: 20, marginTop: 30 }}
|
|
534
531
|
onClick={() => handleClickBusiness()}
|
|
535
532
|
isDisabled={isAsap || !(dateSelected && timeSelected)}
|
|
@@ -555,21 +552,21 @@ export const BusinessPreorder = (props: any) => {
|
|
|
555
552
|
currentDate.setMinutes(59)
|
|
556
553
|
|
|
557
554
|
const cateringTypeString = orderState?.options?.type === 7
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
555
|
+
? 'catering_delivery'
|
|
556
|
+
: orderState?.options?.type === 8
|
|
557
|
+
? 'catering_pickup'
|
|
558
|
+
: null
|
|
562
559
|
|
|
563
|
-
const splitCateringValue = (configName
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
|
|
569
|
-
const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
|
|
570
|
-
const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
|
|
571
|
-
const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
|
|
572
|
-
const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
|
|
560
|
+
const splitCateringValue = (configName: string) =>
|
|
561
|
+
Object.values(props?.business?.configs || {})
|
|
562
|
+
?.find(config => config?.key === configName)
|
|
563
|
+
?.value?.split('|')
|
|
564
|
+
?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
|
|
565
|
+
const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
|
|
566
|
+
const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
|
|
567
|
+
const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
|
|
568
|
+
const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
|
|
569
|
+
const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
|
|
573
570
|
|
|
574
571
|
const businessPreorderProps = {
|
|
575
572
|
...props,
|
|
@@ -558,9 +558,8 @@ const CartUI = (props: any) => {
|
|
|
558
558
|
)}
|
|
559
559
|
bgColor={(subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
|
|
560
560
|
isDisabled={(openUpselling && !canOpenUpselling) || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
|
|
561
|
-
borderColor={theme.colors.primary}
|
|
562
561
|
imgRightSrc={null}
|
|
563
|
-
textStyle={{
|
|
562
|
+
textStyle={{ textAlign: 'center', flex: 1 }}
|
|
564
563
|
onClick={() => handleClickCheckout()}
|
|
565
564
|
style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
566
565
|
/>
|
|
@@ -175,9 +175,8 @@ export const CartContent = (props: any) => {
|
|
|
175
175
|
text={t('CHECKOUT', 'Checkout')}
|
|
176
176
|
bgColor={!cartsAvailable.length ? theme.colors.secundary : theme.colors.primary}
|
|
177
177
|
isDisabled={!cartsAvailable.length}
|
|
178
|
-
borderColor={theme.colors.primary}
|
|
178
|
+
borderColor={!cartsAvailable.length ? theme.colors.secundary : theme.colors.primary}
|
|
179
179
|
imgRightSrc={null}
|
|
180
|
-
textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
|
|
181
180
|
onClick={() => handleCheckoutRedirect()}
|
|
182
181
|
style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
183
182
|
/>
|
|
@@ -168,6 +168,7 @@ const CheckoutUI = (props: any) => {
|
|
|
168
168
|
const [webviewPaymethod, setWebviewPaymethod] = useState<any>(null)
|
|
169
169
|
const [isOpen, setIsOpen] = useState(false)
|
|
170
170
|
const [requiredFields, setRequiredFields] = useState<any>([])
|
|
171
|
+
const [orderTypeValidationFields, setOrderTypeValidationFields] = useState<any>([])
|
|
171
172
|
const [openModal, setOpenModal] = useState({ login: false, signup: false, isGuest: false })
|
|
172
173
|
const [allowedGuest, setAllowedGuest] = useState(false)
|
|
173
174
|
const [placeByMethodPay, setPlaceByMethodPay] = useState(false)
|
|
@@ -179,7 +180,7 @@ const CheckoutUI = (props: any) => {
|
|
|
179
180
|
const containerRef = useRef<any>()
|
|
180
181
|
const cardsMethods = ['credomatic']
|
|
181
182
|
const stripePaymethods: any = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect']
|
|
182
|
-
const notFields = ['coupon', '
|
|
183
|
+
const notFields = ['coupon', 'mobile_phone', 'address', 'zipcode', 'address_notes']
|
|
183
184
|
const placeSpotTypes = [3, 4, 5]
|
|
184
185
|
const placeSpotsEnabled = placeSpotTypes.includes(options?.type)
|
|
185
186
|
const businessConfigs = businessDetails?.business?.configs ?? []
|
|
@@ -342,22 +343,22 @@ const CheckoutUI = (props: any) => {
|
|
|
342
343
|
const checkGuestValidationFields = () => {
|
|
343
344
|
const userSelected = user
|
|
344
345
|
const _requiredFields = checkoutFieldsState?.fields
|
|
345
|
-
.filter((field: any) => (field?.order_type_id === options?.type) && field?.enabled && field?.
|
|
346
|
+
.filter((field: any) => (field?.order_type_id === options?.type) && field?.enabled && field?.required_with_guest &&
|
|
346
347
|
!notFields.includes(field?.validation_field?.code) &&
|
|
347
348
|
userSelected && !userSelected[field?.validation_field?.code])
|
|
348
|
-
|
|
349
|
+
const requiredFieldsCode = _requiredFields.map((item: any) => item?.validation_field?.code)
|
|
349
350
|
const guestCheckoutCellPhone = checkoutFieldsState?.fields?.find((field: any) => field.order_type_id === options?.type && field?.validation_field?.code === 'mobile_phone')
|
|
350
|
-
|
|
351
351
|
if (
|
|
352
352
|
userSelected &&
|
|
353
353
|
!userSelected?.cellphone &&
|
|
354
354
|
((guestCheckoutCellPhone?.enabled &&
|
|
355
|
-
guestCheckoutCellPhone?.
|
|
355
|
+
guestCheckoutCellPhone?.required_with_guest) ||
|
|
356
356
|
configs?.verification_phone_required?.value === '1')
|
|
357
357
|
) {
|
|
358
|
-
|
|
358
|
+
requiredFieldsCode.push('cellphone')
|
|
359
359
|
}
|
|
360
|
-
setRequiredFields(
|
|
360
|
+
setRequiredFields(requiredFieldsCode)
|
|
361
|
+
setOrderTypeValidationFields(_requiredFields)
|
|
361
362
|
}
|
|
362
363
|
|
|
363
364
|
const togglePhoneUpdate = (val: boolean) => {
|
|
@@ -646,17 +647,11 @@ const CheckoutUI = (props: any) => {
|
|
|
646
647
|
<HeaderTitle text={t('CUSTOMER_DETAILS', 'Customer details')} />
|
|
647
648
|
<OButton
|
|
648
649
|
text={t('SIGN_UP', 'Sign up')}
|
|
649
|
-
textStyle={{ color: theme.colors.white }}
|
|
650
|
-
bgColor={theme.colors.primary}
|
|
651
|
-
borderColor={theme.colors.primary}
|
|
652
650
|
style={{ borderRadius: 7.6, marginTop: 20 }}
|
|
653
651
|
onClick={() => setOpenModal({ ...openModal, signup: true })}
|
|
654
652
|
/>
|
|
655
653
|
<OButton
|
|
656
654
|
text={t('LOGIN', 'Login')}
|
|
657
|
-
textStyle={{ color: theme.colors.white }}
|
|
658
|
-
bgColor={theme.colors.primary}
|
|
659
|
-
borderColor={theme.colors.primary}
|
|
660
655
|
style={{ borderRadius: 7.6, marginTop: 20 }}
|
|
661
656
|
onClick={() => setOpenModal({ ...openModal, login: true })}
|
|
662
657
|
/>
|
|
@@ -1051,8 +1046,10 @@ const CheckoutUI = (props: any) => {
|
|
|
1051
1046
|
phoneUpdate={phoneUpdate}
|
|
1052
1047
|
togglePhoneUpdate={togglePhoneUpdate}
|
|
1053
1048
|
requiredFields={requiredFields}
|
|
1049
|
+
orderTypeValidationFields={orderTypeValidationFields}
|
|
1054
1050
|
hideUpdateButton
|
|
1055
1051
|
handlePlaceOrderAsGuest={handlePlaceOrderAsGuest}
|
|
1052
|
+
isGuest={!!user?.guest_id}
|
|
1056
1053
|
onClose={() => {
|
|
1057
1054
|
setIsOpen(false)
|
|
1058
1055
|
if (paymethodClicked) {
|
|
@@ -69,10 +69,7 @@ export const CitiesControl = (props: any) => {
|
|
|
69
69
|
</View>
|
|
70
70
|
<OButton
|
|
71
71
|
text={t('CONTINUE', 'Continue')}
|
|
72
|
-
bgColor={theme.colors.primary}
|
|
73
|
-
borderColor={theme.colors.primary}
|
|
74
72
|
style={styles.btnStyle}
|
|
75
|
-
textStyle={{ color: 'white' }}
|
|
76
73
|
onClick={() => handleClick()}
|
|
77
74
|
/>
|
|
78
75
|
</Container>
|
|
@@ -102,9 +102,7 @@ const CouponControlUI = (props: any) => {
|
|
|
102
102
|
/>
|
|
103
103
|
<OButton
|
|
104
104
|
onClick={() => onButtonApplyClick()}
|
|
105
|
-
|
|
106
|
-
borderColor={theme.colors.primary}
|
|
107
|
-
textStyle={{ color: 'white', fontSize: 12 }}
|
|
105
|
+
textStyle={{ fontSize: 12 }}
|
|
108
106
|
imgRightSrc={null}
|
|
109
107
|
text={t('APPLY', 'Apply')}
|
|
110
108
|
isDisabled={!couponInput}
|
|
@@ -125,9 +125,7 @@ const DriverTipsUI = (props: any) => {
|
|
|
125
125
|
/>
|
|
126
126
|
<OButton
|
|
127
127
|
text={t('APPLY_TIP', 'Apply Tip')}
|
|
128
|
-
|
|
129
|
-
borderColor={theme.colors.primary}
|
|
130
|
-
textStyle={{ color: 'white', fontSize: 14 }}
|
|
128
|
+
textStyle={{ fontSize: 14 }}
|
|
131
129
|
imgRightSrc={null}
|
|
132
130
|
style={{ borderRadius: 5, height: 44 }}
|
|
133
131
|
isDisabled={parseFloat(value || '0') < 0 || parseFloat(value || '0') === driverTip || value === ''}
|
|
@@ -44,11 +44,6 @@ export const Favorite = (props: any) => {
|
|
|
44
44
|
paddingTop={Platform.OS === 'ios' ? 20 : 10}
|
|
45
45
|
style={{ paddingVertical: 0 }}
|
|
46
46
|
btnStyle={{ paddingLeft: 0 }}
|
|
47
|
-
buttonProps={{
|
|
48
|
-
bgColor: theme.colors.white,
|
|
49
|
-
borderColor: theme.colors.white,
|
|
50
|
-
textStyle: { color: theme.colors.btnFont }
|
|
51
|
-
}}
|
|
52
47
|
/>
|
|
53
48
|
<TabContainer>
|
|
54
49
|
{tabList.map((menu, i) => (
|
|
@@ -270,7 +270,6 @@ const FavoriteListUI = (props: FavoriteParams) => {
|
|
|
270
270
|
onClick={() => getFavoriteList(pagination?.currentPage + 1)}
|
|
271
271
|
text={t('LOAD_MORE_ITEMS', 'Load more items')}
|
|
272
272
|
imgRightSrc={null}
|
|
273
|
-
textStyle={{ color: theme.colors.white }}
|
|
274
273
|
style={{ borderRadius: 7.6, shadowOpacity: 0, marginTop: 20 }}
|
|
275
274
|
/>
|
|
276
275
|
</WrappButton>
|
|
@@ -64,7 +64,7 @@ const ForgotPasswordUI = (props: any) => {
|
|
|
64
64
|
handleReCaptcha(null)
|
|
65
65
|
if (reCaptchaValue) return
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
if (!recaptchaConfig?.siteKey) {
|
|
68
68
|
showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
|
|
69
69
|
return
|
|
70
70
|
}
|
|
@@ -73,7 +73,7 @@ const ForgotPasswordUI = (props: any) => {
|
|
|
73
73
|
return
|
|
74
74
|
}
|
|
75
75
|
recaptchaRef.current.open()
|
|
76
|
-
|
|
76
|
+
}
|
|
77
77
|
|
|
78
78
|
const onRecaptchaVerify = (token: any) => {
|
|
79
79
|
setRecaptchaVerified(true)
|
|
@@ -92,8 +92,8 @@ const ForgotPasswordUI = (props: any) => {
|
|
|
92
92
|
formState.result?.result && showToast(
|
|
93
93
|
ToastType.Error,
|
|
94
94
|
typeof formState.result?.result === 'string'
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
? formState.result?.result
|
|
96
|
+
: formState.result?.result[0]
|
|
97
97
|
)
|
|
98
98
|
return
|
|
99
99
|
}
|
|
@@ -125,11 +125,6 @@ const ForgotPasswordUI = (props: any) => {
|
|
|
125
125
|
style={{ flexDirection: 'column', alignItems: 'flex-start' }}
|
|
126
126
|
titleStyle={{ width: '100%', marginLeft: 0, paddingLeft: 0 }}
|
|
127
127
|
titleWrapStyle={{ paddingHorizontal: 0, paddingStart: 0, flex: 1 }}
|
|
128
|
-
buttonProps={{
|
|
129
|
-
bgColor: theme.colors.white,
|
|
130
|
-
borderColor: theme.colors.white,
|
|
131
|
-
textStyle: { color: theme.colors.btnFont }
|
|
132
|
-
}}
|
|
133
128
|
/>
|
|
134
129
|
<FormSide>
|
|
135
130
|
<OText
|
|
@@ -213,7 +208,6 @@ const ForgotPasswordUI = (props: any) => {
|
|
|
213
208
|
|
|
214
209
|
<OButton
|
|
215
210
|
text={emailSent && !formState.result?.error ? t('LINK_SEND_FORGOT_PASSWORD', 'Link Sent') : t('FRONT_RECOVER_PASSWORD', 'Recover Password')}
|
|
216
|
-
textStyle={{ color: 'white' }}
|
|
217
211
|
bgColor={emailSent && !formState.result?.error ? theme.colors.disabled : theme.colors.primary}
|
|
218
212
|
borderColor={emailSent && !formState.result?.error ? theme.colors.disabled : theme.colors.primary}
|
|
219
213
|
isLoading={formState.loading}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Container
|
|
13
13
|
} from './styles'
|
|
14
14
|
|
|
15
|
-
export const GiftCardUI =
|
|
15
|
+
export const GiftCardUI = React.memo((props: any) => {
|
|
16
16
|
const {
|
|
17
17
|
navigation
|
|
18
18
|
} = props
|
|
@@ -57,9 +57,7 @@ export const GiftCardUI = React.memo((props: any) => {
|
|
|
57
57
|
<OButton
|
|
58
58
|
onClick={() => setOpenModal('purchase')}
|
|
59
59
|
text={t('PURCHASE', 'Purchase')}
|
|
60
|
-
|
|
61
|
-
borderColor={theme.colors.primary}
|
|
62
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
60
|
+
textStyle={{ fontSize: 13 }}
|
|
63
61
|
imgRightSrc={null}
|
|
64
62
|
style={{ ...style.btnStyle, marginRight: 14 }}
|
|
65
63
|
/>
|
|
@@ -76,26 +74,26 @@ export const GiftCardUI = React.memo((props: any) => {
|
|
|
76
74
|
</View>
|
|
77
75
|
|
|
78
76
|
<OModal
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
open={openModal === 'purchase'}
|
|
78
|
+
onClose={() => setOpenModal(null)}
|
|
79
|
+
entireModal
|
|
82
80
|
customClose
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
>
|
|
82
|
+
<PurchaseGiftCard
|
|
85
83
|
handleCustomGoToCheckout={handleCustomGoToCheckout}
|
|
86
84
|
onClose={() => setOpenModal(null)}
|
|
87
85
|
/>
|
|
88
|
-
|
|
86
|
+
</OModal>
|
|
89
87
|
<OModal
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
open={openModal === 'redeem'}
|
|
89
|
+
onClose={() => setOpenModal(null)}
|
|
90
|
+
entireModal
|
|
93
91
|
customClose
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
>
|
|
93
|
+
<RedeemGiftCard
|
|
96
94
|
onClose={() => setOpenModal(null)}
|
|
97
95
|
/>
|
|
98
|
-
|
|
96
|
+
</OModal>
|
|
99
97
|
</Container>
|
|
100
98
|
)
|
|
101
|
-
})
|
|
99
|
+
})
|
|
@@ -58,12 +58,10 @@ const PurchaseGiftCardUI = (props: any) => {
|
|
|
58
58
|
borderWidth: 0,
|
|
59
59
|
width: 26,
|
|
60
60
|
height: 26,
|
|
61
|
-
backgroundColor: '#FFF',
|
|
62
|
-
borderColor: '#FFF',
|
|
63
|
-
shadowColor: '#FFF',
|
|
64
61
|
paddingLeft: 0,
|
|
65
62
|
paddingRight: 0,
|
|
66
63
|
}}
|
|
64
|
+
useArrow
|
|
67
65
|
onClick={onClose}
|
|
68
66
|
icon={AntDesignIcon}
|
|
69
67
|
iconProps={{
|
|
@@ -113,9 +111,7 @@ const PurchaseGiftCardUI = (props: any) => {
|
|
|
113
111
|
<OButton
|
|
114
112
|
onClick={() => handleAccept()}
|
|
115
113
|
text={t('ACCEPT', 'Accept')}
|
|
116
|
-
|
|
117
|
-
borderColor={theme.colors.primary}
|
|
118
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
114
|
+
textStyle={{ fontSize: 13 }}
|
|
119
115
|
imgRightSrc={null}
|
|
120
116
|
style={style.btnStyle}
|
|
121
117
|
isDisabled={!selectedProduct}
|
|
@@ -130,4 +126,4 @@ export const PurchaseGiftCard = (props: any) => {
|
|
|
130
126
|
UIComponent: PurchaseGiftCardUI
|
|
131
127
|
}
|
|
132
128
|
return <PurchaseGiftCardController {...purchaseGiftCardProps} />
|
|
133
|
-
}
|
|
129
|
+
}
|
|
@@ -36,10 +36,10 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
36
36
|
marginTop: 20
|
|
37
37
|
},
|
|
38
38
|
inputStyle: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
borderWidth: 1,
|
|
40
|
+
borderColor: theme.colors.border,
|
|
41
|
+
borderRadius: 7.6,
|
|
42
|
+
},
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
const onSubmit = (values) => {
|
|
@@ -65,7 +65,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
65
65
|
t('ERROR', 'Error'),
|
|
66
66
|
stringError,
|
|
67
67
|
[
|
|
68
|
-
{ text: t('OK', 'oK'), onPress: () => {} }
|
|
68
|
+
{ text: t('OK', 'oK'), onPress: () => { } }
|
|
69
69
|
]
|
|
70
70
|
)
|
|
71
71
|
}
|
|
@@ -85,7 +85,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
85
85
|
t('ERROR', 'Error'),
|
|
86
86
|
stringError,
|
|
87
87
|
[
|
|
88
|
-
{ text: t('OK', 'oK'), onPress: () => {} }
|
|
88
|
+
{ text: t('OK', 'oK'), onPress: () => { } }
|
|
89
89
|
]
|
|
90
90
|
)
|
|
91
91
|
}, [actionState.error])
|
|
@@ -108,12 +108,10 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
108
108
|
borderWidth: 0,
|
|
109
109
|
width: 26,
|
|
110
110
|
height: 26,
|
|
111
|
-
backgroundColor: '#FFF',
|
|
112
|
-
borderColor: '#FFF',
|
|
113
|
-
shadowColor: '#FFF',
|
|
114
111
|
paddingLeft: 0,
|
|
115
112
|
paddingRight: 0,
|
|
116
113
|
}}
|
|
114
|
+
useArrow
|
|
117
115
|
onClick={onClose}
|
|
118
116
|
icon={AntDesignIcon}
|
|
119
117
|
iconProps={{
|
|
@@ -124,25 +122,25 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
124
122
|
}
|
|
125
123
|
}}
|
|
126
124
|
/>
|
|
127
|
-
|
|
125
|
+
<OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
|
|
128
126
|
</View>
|
|
129
127
|
<FormController>
|
|
130
128
|
<OText color={theme.colors.textNormal} size={14} mBottom={10}>{t('GIFT_CARD_CODE', 'Gift card code')}</OText>
|
|
131
129
|
<Controller
|
|
132
130
|
control={control}
|
|
133
131
|
render={({ onChange, value }: any) => (
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
132
|
+
<OInput
|
|
133
|
+
placeholder='XXXX-XXXX-XXXX-XXXX'
|
|
134
|
+
value={codeValue}
|
|
135
|
+
onChange={(val: any) => {
|
|
136
|
+
onChange(val)
|
|
137
|
+
handleChangeCode(val)
|
|
138
|
+
}}
|
|
139
|
+
autoCapitalize='characters'
|
|
140
|
+
autoCorrect={false}
|
|
141
|
+
blurOnSubmit={false}
|
|
142
|
+
style={style.inputStyle}
|
|
143
|
+
/>
|
|
146
144
|
)}
|
|
147
145
|
name='code'
|
|
148
146
|
rules={{
|
|
@@ -178,9 +176,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
178
176
|
<OButton
|
|
179
177
|
onClick={handleSubmit(onSubmit)}
|
|
180
178
|
text={actionState?.loading ? t('LOADING', 'Loading') : t('APPLY_TO_YOUR_BALANCE', 'Apply to your balance')}
|
|
181
|
-
|
|
182
|
-
borderColor={theme.colors.primary}
|
|
183
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
179
|
+
textStyle={{ fontSize: 13 }}
|
|
184
180
|
imgRightSrc={null}
|
|
185
181
|
style={style.btnStyle}
|
|
186
182
|
isDisabled={actionState.loading}
|
|
@@ -202,12 +198,10 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
202
198
|
borderWidth: 0,
|
|
203
199
|
width: 26,
|
|
204
200
|
height: 26,
|
|
205
|
-
backgroundColor: '#FFF',
|
|
206
|
-
borderColor: '#FFF',
|
|
207
|
-
shadowColor: '#FFF',
|
|
208
201
|
paddingLeft: 0,
|
|
209
202
|
paddingRight: 0,
|
|
210
203
|
}}
|
|
204
|
+
useArrow
|
|
211
205
|
onClick={onClose}
|
|
212
206
|
icon={AntDesignIcon}
|
|
213
207
|
iconProps={{
|
|
@@ -218,7 +212,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
218
212
|
}
|
|
219
213
|
}}
|
|
220
214
|
/>
|
|
221
|
-
|
|
215
|
+
<OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('GIFT_CARD', 'Gift card')}</OText>
|
|
222
216
|
</View>
|
|
223
217
|
<View>
|
|
224
218
|
<OText color={theme.colors.textNormal} size={14} mBottom={6}>{t('TYPE', 'Type')}: {redeemedGiftCard?.type}</OText>
|
|
@@ -232,9 +226,7 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
232
226
|
onClose()
|
|
233
227
|
}}
|
|
234
228
|
text={t('OK', 'Ok')}
|
|
235
|
-
|
|
236
|
-
borderColor={theme.colors.primary}
|
|
237
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
229
|
+
textStyle={{ fontSize: 13 }}
|
|
238
230
|
imgRightSrc={null}
|
|
239
231
|
style={style.btnStyle}
|
|
240
232
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
2
|
import { StyleSheet, Platform, Alert } from 'react-native';
|
|
3
|
-
import { useLanguage, SendGiftCard as SendGiftCardController
|
|
3
|
+
import { useLanguage, SendGiftCard as SendGiftCardController } from 'ordering-components/native';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import { OText, OButton, OInput } from '../../shared';
|
|
6
6
|
import { useForm, Controller } from 'react-hook-form'
|
|
@@ -29,10 +29,10 @@ const SendGiftCardUI = (props: any) => {
|
|
|
29
29
|
marginTop: 20
|
|
30
30
|
},
|
|
31
31
|
inputStyle: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
borderWidth: 1,
|
|
33
|
+
borderColor: theme.colors.border,
|
|
34
|
+
borderRadius: 7.6,
|
|
35
|
+
},
|
|
36
36
|
})
|
|
37
37
|
|
|
38
38
|
const onSubmit = (values) => {
|
|
@@ -50,7 +50,7 @@ const SendGiftCardUI = (props: any) => {
|
|
|
50
50
|
t('ERROR', 'Error'),
|
|
51
51
|
stringError,
|
|
52
52
|
[
|
|
53
|
-
{ text: t('OK', 'oK'), onPress: () => {} }
|
|
53
|
+
{ text: t('OK', 'oK'), onPress: () => { } }
|
|
54
54
|
]
|
|
55
55
|
)
|
|
56
56
|
}
|
|
@@ -144,9 +144,7 @@ const SendGiftCardUI = (props: any) => {
|
|
|
144
144
|
<OButton
|
|
145
145
|
onClick={handleSubmit(onSubmit)}
|
|
146
146
|
text={actionState?.loading ? t('LOADING', 'Loading') : t('SEND_GIFT_CARD', 'Send gift card')}
|
|
147
|
-
|
|
148
|
-
borderColor={theme.colors.primary}
|
|
149
|
-
textStyle={{ color: 'white', fontSize: 13 }}
|
|
147
|
+
textStyle={{ fontSize: 13 }}
|
|
150
148
|
imgRightSrc={null}
|
|
151
149
|
style={style.btnStyle}
|
|
152
150
|
isDisabled={actionState.loading}
|