ordering-ui-react-native 0.22.21 → 0.22.22-release

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.
Files changed (164) hide show
  1. package/package.json +6 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/Checkout/index.tsx +40 -39
  5. package/src/components/StripeMethodForm/index.tsx +4 -2
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/context/OfflineActions/index.tsx +236 -0
  8. package/src/types/index.tsx +2 -1
  9. package/themes/business/index.tsx +2 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  11. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  12. package/themes/business/src/components/BusinessController/index.tsx +8 -3
  13. package/themes/business/src/components/BusinessProductList/index.tsx +3 -2
  14. package/themes/business/src/components/Chat/index.tsx +15 -3
  15. package/themes/business/src/components/DriverMap/index.tsx +49 -26
  16. package/themes/business/src/components/FloatingButton/index.tsx +3 -2
  17. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  18. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  19. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  20. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  21. package/themes/business/src/components/MapView/index.tsx +36 -17
  22. package/themes/business/src/components/NewOrderNotification/index.tsx +38 -19
  23. package/themes/business/src/components/OrderDetails/Business.tsx +47 -27
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +134 -53
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +128 -41
  26. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +45 -18
  27. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  28. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +17 -16
  29. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
  30. package/themes/business/src/components/OrderSummary/index.tsx +6 -4
  31. package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
  32. package/themes/business/src/components/OrdersOption/index.tsx +217 -156
  33. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  34. package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
  35. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
  36. package/themes/business/src/components/PreviousOrders/index.tsx +74 -66
  37. package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
  38. package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
  39. package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
  40. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  41. package/themes/business/src/components/PrinterSettings/index.tsx +162 -174
  42. package/themes/business/src/components/PrinterSettings/styles.tsx +14 -1
  43. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  44. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  45. package/themes/business/src/components/StoresList/index.tsx +2 -2
  46. package/themes/business/src/components/UserProfileForm/index.tsx +55 -22
  47. package/themes/business/src/components/UserProfileForm/styles.tsx +7 -0
  48. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  49. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  50. package/themes/business/src/config/currency.tsx +1010 -0
  51. package/themes/business/src/hooks/useLocation.tsx +16 -12
  52. package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
  53. package/themes/business/src/types/index.tsx +16 -4
  54. package/themes/business/src/utils/index.tsx +33 -3
  55. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  57. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  58. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  59. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  60. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  61. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  62. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  63. package/themes/original/index.tsx +11 -0
  64. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  65. package/themes/original/src/components/AddressList/index.tsx +8 -7
  66. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  67. package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
  68. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +103 -92
  70. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +8 -6
  71. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  72. package/themes/original/src/components/BusinessPreorder/index.tsx +46 -28
  73. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
  74. package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
  75. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  76. package/themes/original/src/components/BusinessProductsListing/index.tsx +10 -6
  77. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  78. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  79. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  80. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  81. package/themes/original/src/components/Cart/index.tsx +46 -14
  82. package/themes/original/src/components/CartContent/index.tsx +2 -4
  83. package/themes/original/src/components/Checkout/index.tsx +127 -77
  84. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  85. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  86. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  87. package/themes/original/src/components/Favorite/index.tsx +1 -5
  88. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  89. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  90. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  91. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  92. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  93. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  94. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
  95. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  96. package/themes/original/src/components/Help/index.tsx +2 -0
  97. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  98. package/themes/original/src/components/Home/index.tsx +3 -11
  99. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  100. package/themes/original/src/components/LoginForm/index.tsx +12 -9
  101. package/themes/original/src/components/MessageListing/index.tsx +2 -1
  102. package/themes/original/src/components/Messages/index.tsx +27 -19
  103. package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
  104. package/themes/original/src/components/MomentOption/index.tsx +80 -51
  105. package/themes/original/src/components/MomentSelector/index.tsx +5 -2
  106. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  107. package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
  108. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
  109. package/themes/original/src/components/MyOrders/index.tsx +2 -2
  110. package/themes/original/src/components/NavBar/index.tsx +7 -4
  111. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  112. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  113. package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
  114. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +16 -11
  115. package/themes/original/src/components/OrderDetails/index.tsx +44 -21
  116. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  117. package/themes/original/src/components/OrderProgress/index.tsx +4 -3
  118. package/themes/original/src/components/OrderSummary/index.tsx +29 -10
  119. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  120. package/themes/original/src/components/OrdersOption/index.tsx +3 -6
  121. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  122. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  123. package/themes/original/src/components/PaymentOptions/index.tsx +4 -3
  124. package/themes/original/src/components/PhoneInputNumber/index.tsx +92 -7
  125. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  126. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  127. package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
  128. package/themes/original/src/components/ProductForm/index.tsx +107 -102
  129. package/themes/original/src/components/ProductItemAccordion/index.tsx +50 -43
  130. package/themes/original/src/components/ProductItemAccordion/styles.tsx +0 -3
  131. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  132. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  133. package/themes/original/src/components/Promotions/index.tsx +6 -9
  134. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  135. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  136. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  137. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  138. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  139. package/themes/original/src/components/Sessions/index.tsx +3 -3
  140. package/themes/original/src/components/SignupForm/index.tsx +102 -88
  141. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
  142. package/themes/original/src/components/SingleProductCard/index.tsx +5 -5
  143. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  144. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  145. package/themes/original/src/components/StripeCardsList/index.tsx +16 -3
  146. package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
  147. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  148. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  149. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  150. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  151. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  152. package/themes/original/src/components/UserDetails/index.tsx +17 -16
  153. package/themes/original/src/components/UserFormDetails/index.tsx +164 -135
  154. package/themes/original/src/components/UserProfile/index.tsx +9 -1
  155. package/themes/original/src/components/UserVerification/index.tsx +15 -4
  156. package/themes/original/src/components/Wallets/index.tsx +6 -3
  157. package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
  158. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  159. package/themes/original/src/components/shared/OButton.tsx +5 -4
  160. package/themes/original/src/components/shared/OInput.tsx +4 -8
  161. package/themes/original/src/components/shared/OModal.tsx +7 -2
  162. package/themes/original/src/types/index.tsx +10 -3
  163. package/themes/original/src/utils/index.tsx +30 -1
  164. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -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
- bgColor={theme.colors.primary}
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
- borderWidth: 1,
40
- borderColor: theme.colors.border,
41
- borderRadius: 7.6,
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
- <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('REDEEM_GIFT_CARD', 'Redeem a gift card')}</OText>
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
- <OInput
135
- placeholder='XXXX-XXXX-XXXX-XXXX'
136
- value={codeValue}
137
- onChange={(val: any) => {
138
- onChange(val)
139
- handleChangeCode(val)
140
- }}
141
- autoCapitalize='characters'
142
- autoCorrect={false}
143
- blurOnSubmit={false}
144
- style={style.inputStyle}
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
- bgColor={theme.colors.primary}
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
- <OText color={theme.colors.textNormal} weight='bold' size={20} mLeft={10}>{t('GIFT_CARD', 'Gift card')}</OText>
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
- bgColor={theme.colors.primary}
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 } from 'ordering-components/native';
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
- borderWidth: 1,
33
- borderColor: theme.colors.border,
34
- borderRadius: 7.6,
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
- bgColor={theme.colors.primary}
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}
@@ -2,9 +2,9 @@ import React, { useEffect } from 'react';
2
2
  import { useLanguage, GiftCardOrdersList as GiftCardOrdersListController } from 'ordering-components/native';
3
3
  import { useTheme } from 'styled-components/native';
4
4
  import {
5
- Placeholder,
6
- PlaceholderLine,
7
- Fade
5
+ Placeholder,
6
+ PlaceholderLine,
7
+ Fade
8
8
  } from 'rn-placeholder';
9
9
  import { SingleGiftCard } from '../SingleGiftCard';
10
10
  import { OButton, OText } from '../../shared';
@@ -24,7 +24,7 @@ const VerticalGiftCardOrdersLayoutUI = (props: any) => {
24
24
  onNavigationRedirect
25
25
  } = props
26
26
 
27
- const theme = useTheme();
27
+ const theme = useTheme();
28
28
  const [, t] = useLanguage()
29
29
 
30
30
  useEffect(() => {
@@ -40,8 +40,8 @@ const VerticalGiftCardOrdersLayoutUI = (props: any) => {
40
40
  <PlaceholderLine width={30} height={16} />
41
41
  </Placeholder>
42
42
  ) : giftCards.list?.length > 0 && (
43
- <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={24} style={{ marginTop: 24 }}>{title}</OText>
44
- )}
43
+ <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={24} style={{ marginTop: 24 }}>{title}</OText>
44
+ )}
45
45
  {giftCards.list.map(card => (
46
46
  <SingleGiftCardWrapper key={card.id}>
47
47
  <SingleGiftCard
@@ -62,12 +62,11 @@ const VerticalGiftCardOrdersLayoutUI = (props: any) => {
62
62
  {paginationProps.totalPages && paginationProps.currentPage < paginationProps.totalPages && (
63
63
  <WrappButton>
64
64
  <OButton
65
- onClick={loadMoreOrders}
66
- text={t('LOAD_MORE_ORDERS', 'Load more orders')}
67
- imgRightSrc={null}
68
- textStyle={{ color: theme.colors.white }}
69
- style={{ borderRadius: 7.6, shadowOpacity: 0 }}
70
- />
65
+ onClick={loadMoreOrders}
66
+ text={t('LOAD_MORE_ORDERS', 'Load more orders')}
67
+ imgRightSrc={null}
68
+ style={{ borderRadius: 7.6, shadowOpacity: 0 }}
69
+ />
71
70
  </WrappButton>
72
71
  )}
73
72
  </ProductsListContainer>
@@ -8,7 +8,6 @@ import Alert from '../../../../../src/providers/AlertProvider'
8
8
  import { OIcon } from '../shared';
9
9
 
10
10
  export const GoogleMap = (props: GoogleMapsParams) => {
11
-
12
11
  const {
13
12
  location,
14
13
  handleChangeAddressMap,
@@ -21,7 +20,10 @@ export const GoogleMap = (props: GoogleMapsParams) => {
21
20
  locations,
22
21
  isIntGeoCoder,
23
22
  businessZones,
24
- delta
23
+ delta,
24
+ autoCompleteAddress,
25
+ setAutoCompleteAddress,
26
+ manualZoom
25
27
  } = props
26
28
 
27
29
  const [, t] = useLanguage()
@@ -59,7 +61,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
59
61
  strokeWidth: 2
60
62
  }
61
63
 
62
- const geocodePosition = (pos: { latitude: number, longitude: number }, isMovingRegion ?: boolean) => {
64
+ const geocodePosition = (pos: { latitude: number, longitude: number }, isMovingRegion?: boolean) => {
63
65
  Geocoder.from({
64
66
  latitude: pos.latitude,
65
67
  longitude: pos.longitude
@@ -84,7 +86,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
84
86
  }
85
87
  handleChangeAddressMap && handleChangeAddressMap(address, details)
86
88
  setSaveLocation && setSaveLocation(false)
87
- if(!isMovingRegion){
89
+ if (!isMovingRegion) {
88
90
  handleToggleMap && handleToggleMap()
89
91
  }
90
92
  } else {
@@ -95,7 +97,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
95
97
  })
96
98
  }
97
99
 
98
- const validateResult = (curPos: { latitude: number, longitude: number }) => {
100
+ const validateResult = (curPos: any) => {
99
101
  const loc1 = center
100
102
  const loc2 = curPos
101
103
  const distance = calculateDistance(loc1, loc2)
@@ -103,25 +105,33 @@ export const GoogleMap = (props: GoogleMapsParams) => {
103
105
  if (!maxLimitLocation) {
104
106
  geocodePosition(curPos)
105
107
  setMarkerPosition(curPos)
106
- setRegion({ ...region, longitude: curPos.longitude, latitude: curPos.latitude })
108
+ if (!autoCompleteAddress) {
109
+ setRegion({ longitude: curPos?.longitude || 0, latitude: curPos?.latitude || 0, latitudeDelta: curPos?.latitudeDelta || 0.0010, longitudeDelta: curPos?.longitudeDelta || (delta ?? 0.0010) * ASPECT_RATIO })
110
+ } else {
111
+ setRegion({ longitude: curPos?.longitude, latitude: curPos?.latitude, latitudeDelta: delta ?? 0.0010, longitudeDelta: (delta ?? 0.0010) * ASPECT_RATIO })
112
+ }
107
113
  return
108
114
  }
109
115
 
110
116
  const _maxLimitLocation = typeof maxLimitLocation === 'string' ? parseInt(maxLimitLocation, 10) : maxLimitLocation
111
117
 
112
118
  if (distance <= _maxLimitLocation) {
113
- if (!aproxEqual(curPos.latitude, center.lat) || !aproxEqual(curPos.longitude, center.lng)){
119
+ if (!aproxEqual(curPos?.latitude, center.lat) || !aproxEqual(curPos?.longitude, center.lng)) {
114
120
  geocodePosition(curPos, true)
115
121
  }
116
122
  setMarkerPosition(curPos)
117
- setRegion({ ...region, longitude: curPos.longitude, latitude: curPos.latitude })
123
+ if (!autoCompleteAddress) {
124
+ setRegion({ longitude: curPos?.longitude || 0, latitude: curPos?.latitude || 0, latitudeDelta: curPos?.latitudeDelta || 0.0010, longitudeDelta: curPos?.longitudeDelta || (delta ?? 0.0010) * ASPECT_RATIO })
125
+ } else {
126
+ setRegion({ longitude: curPos?.longitude, latitude: curPos?.latitude, latitudeDelta: delta ?? 0.0010, longitudeDelta: (delta ?? 0.0010) * ASPECT_RATIO })
127
+ }
118
128
  } else {
119
129
  setMapErrors && setMapErrors('ERROR_MAX_LIMIT_LOCATION')
120
130
  setMarkerPosition({ latitude: center.lat, longitude: center.lng })
121
131
  }
122
132
  }
123
133
 
124
- const aproxEqual = (n1 : number, n2 : number, epsilon = 0.000001) => {
134
+ const aproxEqual = (n1: number, n2: number, epsilon = 0.000001) => {
125
135
  return Math.abs(n1 - n2) < epsilon
126
136
  }
127
137
 
@@ -182,11 +192,21 @@ export const GoogleMap = (props: GoogleMapsParams) => {
182
192
  }, [isIntGeoCoder])
183
193
 
184
194
  useEffect(() => {
185
- mapRef.current.animateToRegion({
186
- ...region,
195
+ const regionConfig = {
187
196
  latitude: location?.lat,
188
197
  longitude: location?.lng,
189
- })
198
+ latitudeDelta: region?.latitudeDelta ?? delta ?? 0.0010,
199
+ longitudeDelta: region?.longitudeDelta ?? (delta ?? 0.0010) * ASPECT_RATIO
200
+ }
201
+
202
+ mapRef.current.animateToRegion(autoCompleteAddress
203
+ ? regionConfig
204
+ : { ...region, ...regionConfig }
205
+ )
206
+
207
+ if (autoCompleteAddress) {
208
+ setAutoCompleteAddress && setAutoCompleteAddress(false)
209
+ }
190
210
  }, [location])
191
211
 
192
212
  useEffect(() => {
@@ -197,11 +217,12 @@ export const GoogleMap = (props: GoogleMapsParams) => {
197
217
 
198
218
  useEffect(() => {
199
219
  const interval = setInterval(() => {
200
- if (mapRef.current && locations) {
220
+ if (mapRef.current && locations && !manualZoom) {
201
221
  fitAllMarkers()
202
222
  }
203
223
  }, 1000)
204
224
  if (locations) {
225
+ fitAllMarkers()
205
226
  SETMARKERS(locations)
206
227
  }
207
228
  return () => clearInterval(interval)
@@ -213,7 +234,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
213
234
  provider={PROVIDER_GOOGLE}
214
235
  initialRegion={region}
215
236
  style={styles.map}
216
- onRegionChangeComplete={!readOnly ? (coordinates) => handleChangeRegion(coordinates) : () => { }}
237
+ onRegionChangeComplete={!readOnly ? (coordinates) => { handleChangeRegion(coordinates) } : () => { }}
217
238
  zoomTapEnabled
218
239
  zoomEnabled
219
240
  zoomControlEnabled
@@ -249,7 +270,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
249
270
  <React.Fragment key={i}>
250
271
  {businessZone?.type === 2 && Array.isArray(businessZone?.data) && (
251
272
  <Polygon
252
- coordinates={businessZone?.data.map((item: any) => ({ latitude: item.lat, longitude: item.lng}))}
273
+ coordinates={businessZone?.data.map((item: any) => ({ latitude: item.lat, longitude: item.lng }))}
253
274
  fillColor={fillStyles.fillColor}
254
275
  strokeColor={fillStyles.strokeColor}
255
276
  strokeWidth={fillStyles.strokeWidth}
@@ -257,7 +278,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
257
278
  )}
258
279
  {(businessZone.type === 1 && businessZone?.data?.center && businessZone?.data?.radio) && (
259
280
  <Circle
260
- center={{ latitude: businessZone?.data?.center.lat, longitude: businessZone?.data?.center.lng}}
281
+ center={{ latitude: businessZone?.data?.center.lat, longitude: businessZone?.data?.center.lng }}
261
282
  radius={businessZone?.data.radio * 1000}
262
283
  fillColor={fillStyles.fillColor}
263
284
  strokeColor={fillStyles.strokeColor}
@@ -266,7 +287,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
266
287
  )}
267
288
  {(businessZone.type === 5 && businessZone?.data?.distance) && (
268
289
  <Circle
269
- center={{ latitude: center.lat, longitude: center.lng}}
290
+ center={{ latitude: center.lat, longitude: center.lng }}
270
291
  radius={businessZone?.data.distance * units[businessZone?.data?.unit]}
271
292
  fillColor={fillStyles.fillColor}
272
293
  strokeColor={fillStyles.strokeColor}
@@ -275,7 +296,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
275
296
  )}
276
297
  </React.Fragment>
277
298
  ))}
278
- </MapView>
299
+ </MapView >
279
300
  <Alert
280
301
  open={alertState.open}
281
302
  onAccept={closeAlert}
@@ -1,4 +1,5 @@
1
1
  import React, { useState } from 'react'
2
+ import { useTheme } from 'styled-components/native';
2
3
  import { Platform, RefreshControl } from 'react-native'
3
4
  import { HelpParams } from '../../types'
4
5
  import { useLanguage } from 'ordering-components/native'
@@ -17,6 +18,7 @@ export const Help = (props: HelpParams) => {
17
18
  navigation
18
19
  } = props
19
20
  const [, t] = useLanguage()
21
+ const theme = useTheme()
20
22
  const [refreshing] = useState(false);
21
23
  const [refresh, setRefresh] = useState(false)
22
24
 
@@ -162,4 +162,4 @@ export const HighestRatedBusinesses = (props: any) => {
162
162
  };
163
163
 
164
164
  return <BusinessesListingController {...highestRatedBusinessesProps} />;
165
- };
165
+ };
@@ -18,16 +18,10 @@ export const Home = (props: any) => {
18
18
  const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
19
19
  const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
20
20
 
21
- useEffect(() => {
22
- if (isAllowUnaddressOrderType) {
23
- onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList')
24
- }
25
- }, [isAllowUnaddressOrderType])
26
-
27
21
  return (
28
22
  <View style={styles.container}>
29
23
  <View>
30
- <View style={{ paddingTop: (height <= 756 && Platform.OS !== 'ios') ? (height * 0.05) : 0 }}>
24
+ <View style={{paddingTop: (height <= 756 && Platform.OS !== 'ios') ? (height * 0.05) : 0 }}>
31
25
  <LanguageSelector />
32
26
  </View>
33
27
  <OIcon
@@ -49,11 +43,8 @@ export const Home = (props: any) => {
49
43
  </OText>
50
44
  <OButton
51
45
  text={t('LOGIN_NOW', 'Login now')}
52
- bgColor={theme.colors.primary}
53
- borderColor={theme.colors.primary}
54
46
  style={styles.buttons}
55
47
  isCircle={false}
56
- textStyle={{ color: 'white' }}
57
48
  onClick={() => onNavigationRedirect('Login')}
58
49
  imgRightSrc={null}
59
50
  />
@@ -62,13 +53,14 @@ export const Home = (props: any) => {
62
53
  bgColor={theme.colors.primaryContrast}
63
54
  borderColor={theme.colors.primaryContrast}
64
55
  style={styles.buttons}
56
+ textStyle={{ color: 'black' }}
65
57
  onClick={() => onNavigationRedirect('Signup')}
66
58
  imgRightSrc={null}
67
59
  />
68
60
  <TouchableOpacity
69
61
  style={{ ...styles.textLink, marginTop: 12 }}
70
62
  onPress={() =>
71
- orderState?.options?.address?.address
63
+ orderState?.options?.address?.address || isAllowUnaddressOrderType
72
64
  ? onNavigationRedirect(!!businessSlug ? 'Business' : 'BusinessList', { isGuestUser: true })
73
65
  : onNavigationRedirect('AddressForm', { isGuestUser: true })
74
66
  }>
@@ -145,9 +145,6 @@ export const Otp = (props: otpParams) => {
145
145
  </TouchableOpacity>
146
146
  <OButton
147
147
  onClick={() => handleCloseOtp()}
148
- bgColor={theme.colors.white}
149
- borderColor={theme.colors.primary}
150
- textStyle={{ color: theme.colors.primary }}
151
148
  style={{ borderRadius: 8, width: '100%' }}
152
149
  text={t('CANCEL', 'Cancel')}
153
150
  />
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState, useRef } from 'react';
2
- import { StyleSheet, View, Keyboard, Modal } from 'react-native';
2
+ import { StyleSheet, View, Keyboard, Modal, Platform } from 'react-native';
3
3
  import Spinner from 'react-native-loading-spinner-overlay';
4
4
  import { useForm, Controller } from 'react-hook-form';
5
5
  import { PhoneInputNumber } from '../PhoneInputNumber';
@@ -73,7 +73,8 @@ const LoginFormUI = (props: LoginParams) => {
73
73
  generateOtpCode,
74
74
  useLoginOtpEmail,
75
75
  useLoginOtpCellphone,
76
- isGuest
76
+ isGuest,
77
+ setCellphoneStartZero
77
78
  } = props;
78
79
 
79
80
  const [, { showToast }] = useToast();
@@ -108,7 +109,7 @@ const LoginFormUI = (props: LoginParams) => {
108
109
 
109
110
  const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
110
111
  const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
111
- const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
112
+ const appleLoginEnabled = Platform.OS === 'ios' && (configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled)
112
113
 
113
114
  const loginStyle = StyleSheet.create({
114
115
  btnOutline: {
@@ -300,6 +301,11 @@ const LoginFormUI = (props: LoginParams) => {
300
301
  setTabLayouts(_tabLayouts)
301
302
  }
302
303
 
304
+ const handleChangePhoneNumber = (number : any, rawNumber: any) => {
305
+ setPhoneInputData(number)
306
+ setCellphoneStartZero && setCellphoneStartZero(rawNumber?.number && rawNumber?.countryCallingCode ? rawNumber?.number : null)
307
+ }
308
+
303
309
  useEffect(() => {
304
310
  if (configs && Object.keys(configs).length > 0 && enableReCaptcha) {
305
311
  if (configs?.security_recaptcha_type?.value === 'v3' &&
@@ -586,7 +592,7 @@ const LoginFormUI = (props: LoginParams) => {
586
592
  <View style={{ marginBottom: 28 }}>
587
593
  <PhoneInputNumber
588
594
  data={phoneInputData}
589
- handleData={(val: any) => setPhoneInputData(val)}
595
+ handleData={handleChangePhoneNumber}
590
596
  textInputProps={{
591
597
  returnKeyType: 'next',
592
598
  onSubmitEditing: () => passwordRef?.current?.focus?.(),
@@ -630,6 +636,7 @@ const LoginFormUI = (props: LoginParams) => {
630
636
  />
631
637
  )
632
638
  }
639
+ autoCapitalize='none'
633
640
  value={value}
634
641
  forwardRef={passwordRef}
635
642
  onChange={(val: any) => onChange(val)}
@@ -706,9 +713,6 @@ const LoginFormUI = (props: LoginParams) => {
706
713
  <OButton
707
714
  onClick={handleSubmit(onSubmit)}
708
715
  text={loginTab !== 'otp' ? loginButtonText : t('GET_VERIFY_CODE', 'Get verify code')}
709
- bgColor={theme.colors.primary}
710
- borderColor={theme.colors.primary}
711
- textStyle={{ color: 'white' }}
712
716
  imgRightSrc={null}
713
717
  isLoading={formState.loading}
714
718
  style={{ borderRadius: 7.6, marginTop: 10, marginBottom: 25 }}
@@ -747,7 +751,6 @@ const LoginFormUI = (props: LoginParams) => {
747
751
  <OButton
748
752
  onClick={handleVerifyCodeClick}
749
753
  text={t('GET_VERIFY_CODE', 'Get Verify Code')}
750
- borderColor={theme.colors.primary}
751
754
  style={loginStyle.btnOutline}
752
755
  imgRightSrc={null}
753
756
  isLoading={isLoadingVerifyModal}
@@ -802,7 +805,7 @@ const LoginFormUI = (props: LoginParams) => {
802
805
  handleSuccessGoogleLogin={handleSuccessFacebook}
803
806
  />
804
807
  )}
805
- {(configs?.apple_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && appleLoginEnabled && (
808
+ {(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
806
809
  <AppleLogin
807
810
  notificationState={notificationState}
808
811
  handleErrors={(err: any) => { showToast(ToastType.Error, err), vibrateApp() }}
@@ -200,7 +200,7 @@ export const OrderListing = (props: OrdersOptionParams) => {
200
200
  const OrderListingProps = {
201
201
  ...props,
202
202
  UIComponent: OrdersOptionUI,
203
- orderStatus: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
203
+ orderStatus: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26],
204
204
  useDefualtSessionManager: true,
205
205
  paginationSettings: {
206
206
  initialPage: 1,
@@ -237,6 +237,7 @@ export const MessageListing = (props: MessageListingParams) => {
237
237
  const [seletedOrder, setSeletedOrder] = useState<any>()
238
238
  const [openMessages, setOpenMessges] = useState(false)
239
239
  const [, t] = useLanguage()
240
+ const theme = useTheme()
240
241
 
241
242
  const goToBack = () => {
242
243
  navigation?.canGoBack() && navigation.goBack()