ordering-ui-react-native 0.22.2 → 0.22.3-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 +138 -64
  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 +173 -154
  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 +112 -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
@@ -171,7 +171,7 @@ const PromotionsUI = (props: PromotionParams) => {
171
171
  onClick={() => handleClickOffer(offer)}
172
172
  text={t('VIEW', 'View')}
173
173
  style={styles.buttonStyle}
174
- textStyle={{ fontSize: 14, color: '#fff', flexWrap: 'nowrap' }}
174
+ textStyle={{ fontSize: 14, flexWrap: 'nowrap' }}
175
175
  />
176
176
  </WrapperSingleOffer>
177
177
  ))}
@@ -182,7 +182,7 @@ const PromotionsUI = (props: PromotionParams) => {
182
182
  title={``}
183
183
  onClose={() => setOpenModal(false)}
184
184
  >
185
- <View style={{ padding: 20 }}>
185
+ <ScrollView style={{ padding: 20 }}>
186
186
  <OText style={{ alignSelf: 'center', fontWeight: '700' }} mBottom={20}>
187
187
  {offerSelected?.name} / {t('VALUE_OF_OFFER', 'Value of offer')}: {offerSelected?.rate_type === 1 ? `${offerSelected?.rate}%` : `${parsePrice(offerSelected?.rate)}`}
188
188
  </OText>
@@ -210,10 +210,7 @@ const PromotionsUI = (props: PromotionParams) => {
210
210
  <OText style={{ marginTop: 10, marginBottom: 10 }}>
211
211
  {t('AVAILABLE_BUSINESSES_FOR_OFFER', 'Available businesses for this offer')}:
212
212
  </OText>
213
- <ScrollView
214
- showsVerticalScrollIndicator={false}
215
- style={{ height: '68%' }}
216
- >
213
+ <View style={{ marginBottom: 70 }}>
217
214
  {offerSelected?.businesses?.map((business: any) => {
218
215
  return (
219
216
  <SingleBusinessOffer key={business.id}>
@@ -238,14 +235,14 @@ const PromotionsUI = (props: PromotionParams) => {
238
235
  onClick={() => handleBusinessClick(business)}
239
236
  text={t('GO_TO_BUSINESSS', 'Go to business')}
240
237
  style={styles.modalButtonStyle}
241
- textStyle={{ fontSize: 10, color: '#fff' }}
238
+ textStyle={{ fontSize: 10 }}
242
239
  />
243
240
  </BusinessInfo>
244
241
  </SingleBusinessOffer>
245
242
  )
246
243
  })}
247
- </ScrollView>
248
- </View>
244
+ </View>
245
+ </ScrollView>
249
246
  </OModal>
250
247
  </PromotionsContainer>
251
248
  </Container>
@@ -293,7 +293,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
293
293
  <FloatingBottomContainer>
294
294
  <ActionContainer>
295
295
  <OButton
296
- textStyle={{ color: theme.colors.white, paddingRight: 10 }}
296
+ textStyle={{ paddingRight: 10 }}
297
297
  text={t('SEND_REVIEW', 'Send Review')}
298
298
  style={{ borderRadius: 8 }}
299
299
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
@@ -227,7 +227,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
227
227
  </View>
228
228
  ) : (
229
229
  <MultiLogosContainer>
230
- {order?.logo?.map((logo : string, i : number) => (
230
+ {order?.logo?.map((logo: string, i: number) => (
231
231
  <React.Fragment key={logo}>
232
232
  <View style={styles.logoWrapper}>
233
233
  <OIcon
@@ -333,7 +333,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
333
333
  <OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
334
334
  </SkipButton>
335
335
  <OButton
336
- textStyle={{ color: theme.colors.white, paddingRight: 10 }}
336
+ textStyle={{ paddingRight: 10 }}
337
337
  text={t('CONTINUE', 'Continue')}
338
338
  style={{ borderRadius: 8 }}
339
339
  imgRightSrc={theme.images.general.arrow_right}
@@ -104,7 +104,7 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
104
104
  <OText weight={700} size={18} color={theme.colors.textNormal}>{t('FRONT_VISUALS_SKIP', 'Skip')}</OText>
105
105
  </SkipButton>
106
106
  <OButton
107
- textStyle={{ color: theme.colors.white, paddingRight: 10 }}
107
+ textStyle={{ paddingRight: 10 }}
108
108
  text={order?.driver && !order?.user_review ? t('CONTINUE', 'Continue') : t('SEND_REVIEW', 'Send Review')}
109
109
  style={{ borderRadius: 8 }}
110
110
  imgRightSrc={theme.images.general.arrow_right}
@@ -90,7 +90,7 @@ export const ReviewTrigger = (props: any) => {
90
90
  </View>
91
91
  ) : (
92
92
  <MultiLogosContainer>
93
- {order?.logo?.map((logo : string, i : number) => (
93
+ {order?.logo?.map((logo: string, i: number) => (
94
94
  <React.Fragment key={logo}>
95
95
  <View style={styles.logoWrapper}>
96
96
  <OIcon
@@ -122,7 +122,7 @@ export const ReviewTrigger = (props: any) => {
122
122
  <FloatingBottomContainer borderTopWidth={0} borderRadius={10}>
123
123
  <ActionContainer>
124
124
  <OButton
125
- textStyle={{ color: theme.colors.white, paddingRight: 10 }}
125
+ textStyle={{ paddingRight: 10 }}
126
126
  text={t('GOTO_REVIEW', 'Go to review')}
127
127
  style={{ borderRadius: 8 }}
128
128
  imgRightSrc={theme.images.general.arrow_right}
@@ -57,9 +57,9 @@ const ServiceFormUI = (props: ServiceFormParams) => {
57
57
  const [{ optimizeImage, parsePrice, parseDate }] = useUtils()
58
58
  const { top } = useSafeAreaInsets()
59
59
  const [{ configs }] = useConfig()
60
- const [orderState] = useOrder()
61
- const [{ auth }] = useSession()
62
- const { product, loading, error } = productObject;
60
+ const [orderState] = useOrder()
61
+ const [{ auth }] = useSession()
62
+ const { product, loading, error } = productObject;
63
63
 
64
64
  const [selectDate, setSelectedDate] = useState<any>(new Date())
65
65
  const [timeList, setTimeList] = useState<any>([])
@@ -77,8 +77,8 @@ const ServiceFormUI = (props: ServiceFormParams) => {
77
77
  const styles = StyleSheet.create({
78
78
  photoStyle: {
79
79
  width: 45,
80
- height: 45,
81
- borderRadius: 7.6
80
+ height: 45,
81
+ borderRadius: 7.6
82
82
  },
83
83
  buttonStyle: {
84
84
  borderRadius: 7.6,
@@ -144,7 +144,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
144
144
  return (moment.utc(item?.start).local().valueOf() <= moment(selectedMoment).valueOf() &&
145
145
  moment(selectedMoment).valueOf() < moment.utc(item?.end).local().valueOf()) ||
146
146
  (moment.utc(item?.start).local().valueOf() < moment(selectedMoment).add(duration, 'minutes').valueOf() &&
147
- moment(selectedMoment).add(duration, 'minutes').valueOf() < moment.utc(item?.end).local().valueOf())
147
+ moment(selectedMoment).add(duration, 'minutes').valueOf() < moment.utc(item?.end).local().valueOf())
148
148
  })
149
149
  return valid
150
150
  }
@@ -166,9 +166,9 @@ const ServiceFormUI = (props: ServiceFormParams) => {
166
166
  }
167
167
 
168
168
  const handleUpdateGuest = () => {
169
- const guestToken = uuid.v4()
170
- if (guestToken) handleCreateGuestUser({ guest_token: guestToken })
171
- }
169
+ const guestToken = uuid.v4()
170
+ if (guestToken) handleCreateGuestUser({ guest_token: guestToken })
171
+ }
172
172
 
173
173
  const customDayHeaderStylesCallback = () => {
174
174
  return {
@@ -193,11 +193,11 @@ const ServiceFormUI = (props: ServiceFormParams) => {
193
193
  }
194
194
 
195
195
  const handleRedirectLogin = () => {
196
- navigation && navigation.navigate('Login', {
197
- store_slug: props.businessSlug
198
- });
196
+ navigation && navigation.navigate('Login', {
197
+ store_slug: props.businessSlug
198
+ });
199
199
  onClose && onClose()
200
- };
200
+ };
201
201
 
202
202
  const getTimes = (curdate: any, menu: any) => {
203
203
  validateSelectedDate(curdate, menu)
@@ -290,7 +290,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
290
290
  setSelectedDate(moment.utc(productCart?.calendar_event?.start).local())
291
291
  setTimeSelected(moment.utc(productCart?.calendar_event?.start).local().format('HH:mm'))
292
292
  }, [productCart])
293
-
293
+
294
294
  return (
295
295
  <>
296
296
  {loading && !error && (
@@ -450,7 +450,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
450
450
  <CalendarWrapper>
451
451
  {(timeList?.length > 0 && isEnabled) ? (
452
452
  <SelectDropdown
453
- ref={dropdownRef}
453
+ ref={dropdownRef}
454
454
  defaultValueByIndex={timeList.findIndex((item: any) => item.value === timeSelected)}
455
455
  data={timeList}
456
456
  onSelect={(selectedItem, index) => {
@@ -462,7 +462,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
462
462
  rowTextForSelection={(item, index) => {
463
463
  return item.text
464
464
  }}
465
- buttonStyle={{borderRadius: 7.6, ...styles.selectOption}}
465
+ buttonStyle={{ borderRadius: 7.6, ...styles.selectOption }}
466
466
  buttonTextStyle={{
467
467
  color: theme.colors.disabled,
468
468
  fontSize: 14,
@@ -485,7 +485,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
485
485
  }}
486
486
  renderCustomizedRowChild={(item, index) => {
487
487
  return (
488
- <Text style={[styles.dropDownRow, { color: isBusyTime(currentProfessional, getMomentTime(item.value)) ? theme.colors.lightGray : theme.colors.primary } ]}>
488
+ <Text style={[styles.dropDownRow, { color: isBusyTime(currentProfessional, getMomentTime(item.value)) ? theme.colors.lightGray : theme.colors.primary }]}>
489
489
  {item.text}
490
490
  </Text>
491
491
  )
@@ -553,7 +553,6 @@ const ServiceFormUI = (props: ServiceFormParams) => {
553
553
  auth &&
554
554
  orderState.options?.address_id)) && (
555
555
  <OButton
556
- bgColor={theme.colors.primary}
557
556
  onClick={() => handleSaveService()}
558
557
  text={orderState.loading
559
558
  ? t('LOADING', 'Loading')
@@ -562,7 +561,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
562
561
  : t('BOOK', 'Book'))}
563
562
  style={styles.buttonStyle}
564
563
  isDisabled={isSoldOut || maxProductQuantity <= 0 || !currentProfessional?.id || !dateSelected || isBusyTime(currentProfessional, dateSelected)}
565
- textStyle={{ fontSize: 14, color: theme.colors.white }}
564
+ textStyle={{ fontSize: 14 }}
566
565
  />
567
566
  )}
568
567
  {auth &&
@@ -577,45 +576,44 @@ const ServiceFormUI = (props: ServiceFormParams) => {
577
576
  ) : (
578
577
  <OButton onClick={() => addressRedirect()} />
579
578
  ))}
580
- {!auth && (
581
- <OButton
582
- isDisabled={isSoldOut || maxProductQuantity <= 0}
583
- onClick={() => handleRedirectLogin()}
584
- text={
585
- isSoldOut || maxProductQuantity <= 0
586
- ? t('SOLD_OUT', 'Sold out')
587
- : t('LOGIN_SIGNUP', 'Login / Sign Up')
588
- }
589
- imgRightSrc=""
590
- textStyle={{ color: theme.colors.primary, fontSize: 14 }}
591
- style={{
592
- height: 44,
593
- borderColor: theme.colors.primary,
594
- backgroundColor: theme.colors.white,
595
- }}
596
- />
597
- )}
598
- {!auth && guestCheckoutEnabled && orderTypeEnabled && (
599
- <TouchableOpacity style={{ marginTop: 10 }} onPress={handleUpdateGuest}>
600
- {actionStatus?.loading ? (
601
- <Placeholder Animation={Fade}>
602
- <PlaceholderLine width={60} height={20} />
603
- </Placeholder>
604
- ) : (
605
- <OText color={theme.colors.primary} size={13}>{t('AS_GUEST_USER', 'As guest user')}</OText>
606
- )}
607
- </TouchableOpacity>
608
- )}
579
+ {!auth && (
580
+ <OButton
581
+ isDisabled={isSoldOut || maxProductQuantity <= 0}
582
+ onClick={() => handleRedirectLogin()}
583
+ text={
584
+ isSoldOut || maxProductQuantity <= 0
585
+ ? t('SOLD_OUT', 'Sold out')
586
+ : t('LOGIN_SIGNUP', 'Login / Sign Up')
587
+ }
588
+ imgRightSrc=""
589
+ textStyle={{ color: theme.colors.primary, fontSize: 14 }}
590
+ style={{
591
+ height: 44,
592
+ backgroundColor: theme.colors.white,
593
+ }}
594
+ />
595
+ )}
596
+ {!auth && guestCheckoutEnabled && orderTypeEnabled && (
597
+ <TouchableOpacity style={{ marginTop: 10 }} onPress={handleUpdateGuest}>
598
+ {actionStatus?.loading ? (
599
+ <Placeholder Animation={Fade}>
600
+ <PlaceholderLine width={60} height={20} />
601
+ </Placeholder>
602
+ ) : (
603
+ <OText color={theme.colors.primary} size={13}>{t('AS_GUEST_USER', 'As guest user')}</OText>
604
+ )}
605
+ </TouchableOpacity>
606
+ )}
609
607
  </ButtonWrapper>
610
608
  </Container>
611
609
  )}
612
610
 
613
611
  <OModal
614
- open={isOpen}
615
- onClose={() => setIsOpen(false)}
616
- entireModal
617
- >
618
- <ScrollView contentContainerStyle={styles.professionalList}>
612
+ open={isOpen}
613
+ onClose={() => setIsOpen(false)}
614
+ entireModal
615
+ >
616
+ <ScrollView contentContainerStyle={styles.professionalList}>
619
617
  <View style={{ paddingVertical: 11 }}>
620
618
  <OText
621
619
  size={14}
@@ -671,7 +669,7 @@ const ServiceFormUI = (props: ServiceFormParams) => {
671
669
  </TouchableOpacity>
672
670
  ))}
673
671
  </ScrollView>
674
- </OModal>
672
+ </OModal>
675
673
  </>
676
674
  )
677
675
  }
@@ -111,14 +111,14 @@ export const SessionsUI = (props: SessionsParams) => {
111
111
  <OButton
112
112
  text={t('DELETE_ALL_SESSIONS', 'Delete all sessions')}
113
113
  isDisabled={actionState.loading}
114
- textStyle={{ color: theme.colors.white, fontSize: 14 }}
114
+ textStyle={{ fontSize: 14 }}
115
115
  onClick={() => onDeleteAllSessions(false, true)}
116
116
  style={{ borderRadius: 7.6, marginTop: 30 }}
117
117
  />
118
118
  <OButton
119
119
  text={t('DELETE_ALL_SESSIONS_EXCEPT_CURRENT', 'Delete all sessions except current')}
120
120
  isDisabled={actionState.loading}
121
- textStyle={{ color: theme.colors.white, fontSize: 14 }}
121
+ textStyle={{ fontSize: 14 }}
122
122
  onClick={() => onDeleteAllSessions(false, false)}
123
123
  style={{ borderRadius: 7.6, marginTop: 20 }}
124
124
  />
@@ -136,7 +136,7 @@ export const SessionsUI = (props: SessionsParams) => {
136
136
  <OButton
137
137
  text={t('ACTIVE_SESSIONS', 'Active sessions')}
138
138
  isDisabled={actionState.loading}
139
- textStyle={{ color: theme.colors.white, fontSize: 14 }}
139
+ textStyle={{ fontSize: 14 }}
140
140
  onClick={() => onDeleteAllSessions(true, false)}
141
141
  style={{ borderRadius: 7.6, marginTop: 20 }}
142
142
  />
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity } from 'react-native';
2
+ import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity, Modal } from 'react-native';
3
3
  import { useForm, Controller } from 'react-hook-form';
4
4
  import Spinner from 'react-native-loading-spinner-overlay';
5
5
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
@@ -32,11 +32,9 @@ import {
32
32
  } from '../LoginForm/styles';
33
33
 
34
34
  import NavBar from '../NavBar';
35
- import { VerifyPhone } from '../VerifyPhone';
36
35
 
37
36
  import Alert from '../../../../../src/providers/AlertProvider'
38
37
  import { OText, OButton, OInput } from '../shared';
39
- import { OModal } from '../../../../../src/components/shared';
40
38
  import { SignupParams } from '../../types';
41
39
  import { sortInputFields } from '../../utils';
42
40
  import { GoogleLogin } from '../GoogleLogin';
@@ -141,6 +139,8 @@ const SignupFormUI = (props: SignupParams) => {
141
139
  const [recaptchaConfig, setRecaptchaConfig] = useState<any>({})
142
140
  const [recaptchaVerified, setRecaptchaVerified] = useState(false)
143
141
  const [tabLayouts, setTabLayouts] = useState<any>({})
142
+ const [isCheckingCode, setCheckingCode] = useState(false)
143
+ const [otpError, setOtpError] = useState(null)
144
144
 
145
145
  const tabsRef = useRef<any>(null)
146
146
  const nameRef = useRef<any>(null);
@@ -155,7 +155,7 @@ const SignupFormUI = (props: SignupParams) => {
155
155
  const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
156
156
  const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
157
157
  const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
158
- const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
158
+ const appleLoginEnabled = Platform.OS === 'ios' && (configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled)
159
159
 
160
160
  const closeAlert = () => {
161
161
  setAlertState({
@@ -467,9 +467,16 @@ const SignupFormUI = (props: SignupParams) => {
467
467
 
468
468
  useEffect(() => {
469
469
  if (checkPhoneCodeState?.result?.error) {
470
- setAlertState({
470
+ const titleText = (
471
+ typeof checkPhoneCodeState?.result?.result === 'string'
472
+ ? checkPhoneCodeState?.result?.result
473
+ : checkPhoneCodeState?.result?.result[0].toString()
474
+ ) || t('ERROR', 'Error')
475
+ setCheckingCode(false)
476
+ setOtpError(titleText)
477
+ checkPhoneCodeState?.generate && setAlertState({
471
478
  open: true,
472
- title: (typeof checkPhoneCodeState?.result?.result === 'string' ? checkPhoneCodeState?.result?.result : checkPhoneCodeState?.result?.result[0].toString()) || t('ERROR', 'Error'),
479
+ title: titleText,
473
480
  content: []
474
481
  })
475
482
  }
@@ -583,65 +590,67 @@ const SignupFormUI = (props: SignupParams) => {
583
590
  {sortInputFields({
584
591
  values: validationFields?.fields?.checkout,
585
592
  }).map(
586
- (field: any, i: number) =>
587
- !notValidationFields.includes(field.code) &&
588
- showField &&
589
- showField(field.code) &&
590
- (signUpTab === 'default' ||
591
- (signUpTab === 'otpEmail' && field.code === 'email')) && (
592
- <React.Fragment key={field.id}>
593
- {errors?.[`${field.code}`] && (
594
- <OText
595
- size={14}
596
- color={theme.colors.danger5}
597
- weight={'normal'}>
598
- {errors?.[`${field.code}`]?.message} {errors?.[`${field.code}`]?.type === 'required' && '*'}
599
- </OText>
600
- )}
601
- <Controller
602
- control={control}
603
- render={({ onChange, value }: any) => (
604
- <OInput
605
- placeholder={t(field.name?.replace(/\s/g, '_')?.toUpperCase(), field.name)}
606
- style={style.inputStyle}
607
- icon={
608
- field.code === 'email'
609
- ? theme.images.general.email
610
- : theme.images.general.user
611
- }
612
- value={value}
613
- onChange={(val: any) =>
614
- field.code !== 'email'
615
- ? (onChange(val))
616
- : handleChangeInputEmail(val, onChange)
617
- }
618
- autoCapitalize={
619
- field.code === 'email' ? 'none' : 'sentences'
620
- }
621
- autoCorrect={field.code === 'email' && false}
622
- type={
623
- field.code === 'email' ? 'email-address' : 'default'
624
- }
625
- autoCompleteType={
626
- field.code === 'email' ? 'email' : 'off'
627
- }
628
- returnKeyType="next"
629
- blurOnSubmit={false}
630
- forwardRef={(ref: any) => handleRefs(ref, field.code)}
631
- onSubmitEditing={() =>
632
- field.code === 'email'
633
- ? phoneRef?.current?.focus?.()
634
- : handleFocusRef(getNextFieldCode(i))
635
- }
636
- borderColor={errors?.[`${field.code}`] ? theme.colors.danger5 : theme.colors.border}
637
- />
593
+ (item: any, i: number) => {
594
+ const field = item?.validation_field || item
595
+ return (!notValidationFields.includes(field.code) &&
596
+ showField &&
597
+ showField(field.code) &&
598
+ (signUpTab === 'default' ||
599
+ (signUpTab === 'otpEmail' && field.code === 'email')) && (
600
+ <React.Fragment key={field.id}>
601
+ {errors?.[`${field.code}`] && (
602
+ <OText
603
+ size={14}
604
+ color={theme.colors.danger5}
605
+ weight={'normal'}>
606
+ {errors?.[`${field.code}`]?.message} {errors?.[`${field.code}`]?.type === 'required' && '*'}
607
+ </OText>
638
608
  )}
639
- name={field.code}
640
- rules={getInputRules(field)}
641
- defaultValue=""
642
- />
643
- </React.Fragment>
644
- ),
609
+ <Controller
610
+ control={control}
611
+ render={({ onChange, value }: any) => (
612
+ <OInput
613
+ placeholder={t(field.name?.replace(/\s/g, '_')?.toUpperCase(), field.name)}
614
+ style={style.inputStyle}
615
+ icon={
616
+ field.code === 'email'
617
+ ? theme.images.general.email
618
+ : theme.images.general.user
619
+ }
620
+ value={value}
621
+ onChange={(val: any) =>
622
+ field.code !== 'email'
623
+ ? (onChange(val))
624
+ : handleChangeInputEmail(val, onChange)
625
+ }
626
+ autoCapitalize={
627
+ field.code === 'email' ? 'none' : 'sentences'
628
+ }
629
+ autoCorrect={field.code === 'email' && false}
630
+ type={
631
+ field.code === 'email' ? 'email-address' : 'default'
632
+ }
633
+ autoCompleteType={
634
+ field.code === 'email' ? 'email' : 'off'
635
+ }
636
+ returnKeyType="next"
637
+ blurOnSubmit={false}
638
+ forwardRef={(ref: any) => handleRefs(ref, field.code)}
639
+ onSubmitEditing={() =>
640
+ field.code === 'email'
641
+ ? phoneRef?.current?.focus?.()
642
+ : handleFocusRef(getNextFieldCode(i))
643
+ }
644
+ borderColor={errors?.[`${field.code}`] ? theme.colors.danger5 : theme.colors.border}
645
+ />
646
+ )}
647
+ name={field.code}
648
+ rules={getInputRules(field)}
649
+ defaultValue=""
650
+ />
651
+ </React.Fragment>
652
+ ))
653
+ }
645
654
  )}
646
655
 
647
656
  {(!!showInputPhoneNumber && (signUpTab === 'default' || signUpTab === 'otpCellphone')) && (
@@ -787,9 +796,9 @@ const SignupFormUI = (props: SignupParams) => {
787
796
  <OButton
788
797
  imgRightSrc={null}
789
798
  text={t('TERMS_AND_CONDITIONS', 'Terms & Conditions')}
790
- bgColor='#FFF'
791
- borderColor='#FFF'
792
- style={{ paddingLeft: 0, paddingRight: 0, height: 30, shadowColor: '#FFF' }}
799
+ bgColor={theme.colors.white}
800
+ borderColor={theme.colors.white}
801
+ style={{ paddingLeft: 0, paddingRight: 0, height: 30, shadowColor: theme.colors.white }}
793
802
  textStyle={{ color: theme.colors.primary, marginLeft: 0, marginRight: 0 }}
794
803
  onClick={() => handleOpenTermsUrl(configs?.terms_and_conditions_url?.value)}
795
804
  />
@@ -833,6 +842,7 @@ const SignupFormUI = (props: SignupParams) => {
833
842
  />
834
843
  )
835
844
  }
845
+ autoCapitalize='none'
836
846
  value={value}
837
847
  onChange={(val: any) => onChange(val)}
838
848
  returnKeyType="done"
@@ -874,9 +884,7 @@ const SignupFormUI = (props: SignupParams) => {
874
884
  <OButton
875
885
  onClick={handleSubmit(onSubmit)}
876
886
  text={t('GET_VERIFY_CODE', 'Get Verify Code')}
877
- borderColor={theme.colors.primary}
878
887
  imgRightSrc={null}
879
- textStyle={{ color: 'white' }}
880
888
  isLoading={isLoadingVerifyModal}
881
889
  indicatorColor={theme.colors.white}
882
890
  style={{ borderRadius: 7.6, marginTop: 6 }}
@@ -885,9 +893,6 @@ const SignupFormUI = (props: SignupParams) => {
885
893
  <OButton
886
894
  onClick={handleSubmit(onSubmit)}
887
895
  text={signupButtonText}
888
- bgColor={theme.colors.primary}
889
- borderColor={theme.colors.primary}
890
- textStyle={{ color: 'white' }}
891
896
  imgRightSrc={null}
892
897
  isDisabled={formState.loading || validationFields.loading}
893
898
  style={{ borderRadius: 7.6, marginTop: 6, shadowOpacity: 0 }}
@@ -969,13 +974,16 @@ const SignupFormUI = (props: SignupParams) => {
969
974
  )
970
975
  )}
971
976
  </FormSide>
972
- <OModal
973
- open={willVerifyOtpState}
974
- onClose={() => setWillVerifyOtpState && setWillVerifyOtpState(false)}
975
- entireModal
976
- title={t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
977
+ <Modal
978
+ visible={willVerifyOtpState}
979
+ onDismiss={() => setWillVerifyOtpState && setWillVerifyOtpState(false)}
980
+ animationType='slide'
977
981
  >
978
982
  <Otp
983
+ isCheckingCode={isCheckingCode}
984
+ setCheckingCode={setCheckingCode}
985
+ otpError={otpError}
986
+ setOtpError={setOtpError}
979
987
  pinCount={numOtpInputs || 6}
980
988
  willVerifyOtpState={willVerifyOtpState || false}
981
989
  setWillVerifyOtpState={() => setWillVerifyOtpState && setWillVerifyOtpState(false)}
@@ -983,7 +991,7 @@ const SignupFormUI = (props: SignupParams) => {
983
991
  onSubmit={onSubmit}
984
992
  setAlertState={setAlertState}
985
993
  />
986
- </OModal>
994
+ </Modal>
987
995
  <Spinner
988
996
  visible={formState.loading || validationFields.loading || isFBLoading}
989
997
  />
@@ -3,7 +3,8 @@ import {
3
3
  SingleOrderCard as SingleOrderCardController,
4
4
  useUtils,
5
5
  useOrder,
6
- useLanguage
6
+ useLanguage,
7
+ useConfig
7
8
  } from 'ordering-components/native';
8
9
  import FastImage from 'react-native-fast-image'
9
10
  import { StyleSheet, TouchableOpacity, View } from 'react-native';
@@ -45,6 +46,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
45
46
  const [{ parsePrice, optimizeImage, parseDate }] = useUtils();
46
47
  const [, t] = useLanguage();
47
48
  const [{ carts }] = useOrder()
49
+ const [{ configs }] = useConfig()
48
50
  const theme = useTheme();
49
51
  const isFocused = useIsFocused();
50
52
 
@@ -54,6 +56,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
54
56
 
55
57
  const allowedOrderStatus = [1, 2, 5, 6, 10, 11, 12, 15];
56
58
  const isGiftCardOrder = !order?.business_id
59
+ const changeIdToExternalId = configs?.change_order_id?.value === '1'
57
60
 
58
61
  const styles = StyleSheet.create({
59
62
  container: {
@@ -82,7 +85,6 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
82
85
  elevation: 3
83
86
  },
84
87
  buttonText: {
85
- color: theme.colors.primary,
86
88
  fontSize: 10,
87
89
  marginLeft: 2,
88
90
  marginRight: 2,
@@ -334,7 +336,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
334
336
  lineHeight={15}
335
337
  numberOfLines={1}
336
338
  >
337
- {order?.business?.length > 1 ? order?.business?.length : (t('ORDER_NO', 'Order No') + '.')}
339
+ {order?.business?.length > 1 ? order?.business?.length : !(changeIdToExternalId && order?.external_id) && (t('ORDER_NO', 'Order No') + '.')}
338
340
  </OText>
339
341
  <OText
340
342
  size={10}
@@ -343,7 +345,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
343
345
  lineHeight={15}
344
346
  numberOfLines={1}
345
347
  >
346
- {order?.business?.length > 1 ? t('ORDERS', 'orders') + ' \u2022 ' : order.id + ` \u2022 `}
348
+ {order?.business?.length > 1 ? t('ORDERS', 'orders') + ' \u2022 ' : ((changeIdToExternalId && order?.external_id) || order.id) + ` \u2022 `}
347
349
  </OText>
348
350
  </>
349
351
  )}
@@ -48,6 +48,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
48
48
  const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
49
49
  const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
50
50
  const hideProductDescription = theme?.business_view?.components?.products?.components?.product?.components?.description?.hidden
51
+ const hideProductDummyLogo = theme?.business_view?.components?.products?.components?.product?.components?.dummy?.hidden
51
52
  const hideProductLogo = viewString
52
53
  ? theme?.[viewString]?.components?.cart?.components?.products?.image?.hidden
53
54
  : theme?.business_view?.components?.products?.components?.product?.components?.image?.hidden
@@ -283,7 +284,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
283
284
  </OText>
284
285
  </RibbonBox>
285
286
  )}
286
- {!hideProductLogo && (
287
+ {(!hideProductLogo && (product?.images || !hideProductDummyLogo)) && (
287
288
  <FastImage
288
289
  style={styles.productStyle}
289
290
  source={product?.images ? {
@@ -313,9 +314,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
313
314
  height: 40
314
315
 
315
316
  }}
316
- bgColor={isSoldOut ? '#B8B8B8' : theme?.colors?.white}
317
- borderColor={theme?.colors.primary}
318
- textStyle={{ color: theme.colors.primary }}
317
+ isDisabled={isSoldOut}
319
318
  text={t('ADD', 'Add')}
320
319
  />
321
320
  )}