ordering-ui-react-native 0.22.1 → 0.22.2-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 (161) 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/StripeMethodForm/index.tsx +4 -2
  5. package/src/components/VerifyPhone/styles.tsx +1 -2
  6. package/src/context/OfflineActions/index.tsx +236 -0
  7. package/src/types/index.tsx +2 -1
  8. package/themes/business/index.tsx +2 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  10. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  11. package/themes/business/src/components/BusinessController/index.tsx +8 -3
  12. package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
  13. package/themes/business/src/components/Chat/index.tsx +15 -3
  14. package/themes/business/src/components/DriverMap/index.tsx +49 -27
  15. package/themes/business/src/components/FloatingButton/index.tsx +3 -2
  16. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  17. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  18. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  19. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  20. package/themes/business/src/components/MapView/index.tsx +36 -17
  21. package/themes/business/src/components/NewOrderNotification/index.tsx +40 -27
  22. package/themes/business/src/components/OrderDetails/Business.tsx +54 -37
  23. package/themes/business/src/components/OrderDetails/Delivery.tsx +138 -55
  24. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +125 -43
  25. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +62 -24
  26. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  27. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +149 -68
  28. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
  29. package/themes/business/src/components/OrderSummary/index.tsx +210 -65
  30. package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
  31. package/themes/business/src/components/OrdersOption/index.tsx +217 -156
  32. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  33. package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
  34. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
  35. package/themes/business/src/components/PreviousOrders/index.tsx +76 -66
  36. package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
  37. package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
  38. package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
  39. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  40. package/themes/business/src/components/PrinterSettings/index.tsx +226 -76
  41. package/themes/business/src/components/PrinterSettings/styles.tsx +20 -0
  42. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  43. package/themes/business/src/components/StoresList/index.tsx +2 -2
  44. package/themes/business/src/components/UserProfileForm/index.tsx +16 -17
  45. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  46. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  47. package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
  48. package/themes/business/src/types/index.tsx +14 -5
  49. package/themes/business/src/utils/index.tsx +25 -1
  50. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  51. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  52. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  53. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  54. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  55. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  56. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  57. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  58. package/themes/original/index.tsx +11 -0
  59. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  60. package/themes/original/src/components/AddressList/index.tsx +8 -7
  61. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  62. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  63. package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
  64. package/themes/original/src/components/BusinessController/index.tsx +5 -5
  65. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  66. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
  67. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
  68. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  69. package/themes/original/src/components/BusinessPreorder/index.tsx +44 -32
  70. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
  71. package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
  72. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  73. package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
  74. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  75. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  76. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
  77. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  78. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  79. package/themes/original/src/components/Cart/index.tsx +38 -14
  80. package/themes/original/src/components/CartContent/index.tsx +2 -4
  81. package/themes/original/src/components/Checkout/index.tsx +110 -58
  82. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  83. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  84. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  85. package/themes/original/src/components/Favorite/index.tsx +1 -5
  86. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  87. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  88. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  89. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  90. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  91. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  92. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
  93. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  94. package/themes/original/src/components/Help/index.tsx +2 -0
  95. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  96. package/themes/original/src/components/Home/index.tsx +3 -11
  97. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  98. package/themes/original/src/components/LoginForm/index.tsx +4 -7
  99. package/themes/original/src/components/MessageListing/index.tsx +2 -1
  100. package/themes/original/src/components/Messages/index.tsx +29 -17
  101. package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
  102. package/themes/original/src/components/MomentOption/index.tsx +79 -56
  103. package/themes/original/src/components/MomentSelector/index.tsx +1 -1
  104. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  105. package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
  106. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
  107. package/themes/original/src/components/MyOrders/index.tsx +2 -2
  108. package/themes/original/src/components/NavBar/index.tsx +7 -4
  109. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  110. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  111. package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
  112. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +13 -10
  113. package/themes/original/src/components/OrderDetails/index.tsx +44 -21
  114. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  115. package/themes/original/src/components/OrderProgress/index.tsx +5 -4
  116. package/themes/original/src/components/OrderSummary/index.tsx +29 -10
  117. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  118. package/themes/original/src/components/OrdersOption/index.tsx +3 -6
  119. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  120. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  121. package/themes/original/src/components/PaymentOptions/index.tsx +10 -8
  122. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  123. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  124. package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
  125. package/themes/original/src/components/ProductForm/index.tsx +107 -102
  126. package/themes/original/src/components/ProductItemAccordion/index.tsx +51 -44
  127. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  128. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  129. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  130. package/themes/original/src/components/Promotions/index.tsx +6 -9
  131. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  132. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  133. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  134. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  135. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  136. package/themes/original/src/components/Sessions/index.tsx +3 -3
  137. package/themes/original/src/components/SignupForm/index.tsx +86 -78
  138. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
  139. package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
  140. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  141. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  142. package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
  143. package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
  144. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  145. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  146. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  147. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  148. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  149. package/themes/original/src/components/UserDetails/index.tsx +17 -16
  150. package/themes/original/src/components/UserFormDetails/index.tsx +159 -133
  151. package/themes/original/src/components/UserProfile/index.tsx +9 -1
  152. package/themes/original/src/components/UserVerification/index.tsx +14 -4
  153. package/themes/original/src/components/Wallets/index.tsx +6 -3
  154. package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
  155. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  156. package/themes/original/src/components/shared/OButton.tsx +5 -4
  157. package/themes/original/src/components/shared/OInput.tsx +4 -8
  158. package/themes/original/src/components/shared/OModal.tsx +7 -2
  159. package/themes/original/src/types/index.tsx +5 -1
  160. package/themes/original/src/utils/index.tsx +30 -1
  161. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -14,8 +14,7 @@ import {
14
14
 
15
15
  export const Favorite = (props: any) => {
16
16
  const {
17
- navigation,
18
- franchiseId
17
+ navigation
19
18
  } = props
20
19
  const [, t] = useLanguage()
21
20
  const theme = useTheme()
@@ -72,7 +71,6 @@ export const Favorite = (props: any) => {
72
71
  originalURL='business'
73
72
  location={`${orderState.options?.address?.location?.lat},${orderState.options?.address?.location?.lng}`}
74
73
  propsToFetch={['id', 'name', 'header', 'logo', 'location', 'address', 'ribbon', 'timezone', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug']}
75
- franchiseId={franchiseId}
76
74
  />
77
75
  )}
78
76
  {tabSelected === 'products' && (
@@ -81,7 +79,6 @@ export const Favorite = (props: any) => {
81
79
  originalURL='products'
82
80
  onNavigationRedirect={onRedirect}
83
81
  isProduct
84
- franchiseId={franchiseId}
85
82
  />
86
83
  )}
87
84
  {tabSelected === 'orders' && (
@@ -90,7 +87,6 @@ export const Favorite = (props: any) => {
90
87
  favoriteURL='favorite_orders'
91
88
  originalURL='orders'
92
89
  isOrder
93
- franchiseId={franchiseId}
94
90
  />
95
91
  )}
96
92
  </Container>
@@ -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
- if (!recaptchaConfig?.siteKey) {
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
- ? formState.result?.result
96
- : formState.result?.result[0]
95
+ ? formState.result?.result
96
+ : formState.result?.result[0]
97
97
  )
98
98
  return
99
99
  }
@@ -208,9 +208,7 @@ const ForgotPasswordUI = (props: any) => {
208
208
 
209
209
  <OButton
210
210
  text={emailSent && !formState.result?.error ? t('LINK_SEND_FORGOT_PASSWORD', 'Link Sent') : t('FRONT_RECOVER_PASSWORD', 'Recover Password')}
211
- textStyle={{ color: 'white' }}
212
- bgColor={emailSent && !formState.result?.error ? theme.colors.disabled : theme.colors.primary}
213
- borderColor={emailSent && !formState.result?.error ? theme.colors.disabled : theme.colors.primary}
211
+ isDisabled={formState.loading || emailSent && !formState.result?.error}
214
212
  isLoading={formState.loading}
215
213
  imgRightSrc={null}
216
214
  onClick={emailSent && !formState.result?.error ? () => { } : handleSubmit(onSubmit)}
@@ -12,7 +12,7 @@ import {
12
12
  Container
13
13
  } from './styles'
14
14
 
15
- export const GiftCardUI = React.memo((props: any) => {
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
- bgColor={theme.colors.primary}
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
- open={openModal === 'purchase'}
80
- onClose={() => setOpenModal(null)}
81
- entireModal
77
+ open={openModal === 'purchase'}
78
+ onClose={() => setOpenModal(null)}
79
+ entireModal
82
80
  customClose
83
- >
84
- <PurchaseGiftCard
81
+ >
82
+ <PurchaseGiftCard
85
83
  handleCustomGoToCheckout={handleCustomGoToCheckout}
86
84
  onClose={() => setOpenModal(null)}
87
85
  />
88
- </OModal>
86
+ </OModal>
89
87
  <OModal
90
- open={openModal === 'redeem'}
91
- onClose={() => setOpenModal(null)}
92
- entireModal
88
+ open={openModal === 'redeem'}
89
+ onClose={() => setOpenModal(null)}
90
+ entireModal
93
91
  customClose
94
- >
95
- <RedeemGiftCard
92
+ >
93
+ <RedeemGiftCard
96
94
  onClose={() => setOpenModal(null)}
97
95
  />
98
- </OModal>
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
- 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
  />