ordering-ui-react-native 0.15.37 → 0.15.38-test

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 (79) hide show
  1. package/package.json +3 -2
  2. package/src/components/BusinessTypeFilter/index.tsx +4 -1
  3. package/src/components/LanguageSelector/index.tsx +1 -0
  4. package/src/components/OrderDetails/index.tsx +2 -2
  5. package/src/components/PaymentOptions/index.tsx +2 -2
  6. package/src/components/StripeMethodForm/index.tsx +22 -21
  7. package/src/pages/BusinessProductsList.tsx +1 -0
  8. package/src/pages/BusinessesListing.tsx +1 -1
  9. package/themes/business/src/components/Home/index.tsx +128 -55
  10. package/themes/business/src/components/Home/styles.tsx +8 -1
  11. package/themes/business/src/components/NewOrderNotification/index.tsx +59 -98
  12. package/themes/business/src/components/OrderDetails/Delivery.tsx +9 -9
  13. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +152 -91
  14. package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
  15. package/themes/business/src/components/OrdersListManager/index.tsx +51 -48
  16. package/themes/business/src/components/OrdersOption/index.tsx +52 -48
  17. package/themes/business/src/components/PreviousOrders/index.tsx +50 -14
  18. package/themes/kiosk/src/components/Cart/index.tsx +99 -25
  19. package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
  20. package/themes/kiosk/src/components/OrderDetails/index.tsx +134 -39
  21. package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
  22. package/themes/kiosk/src/components/ProductForm/index.tsx +2 -2
  23. package/themes/kiosk/src/types/index.d.ts +2 -0
  24. package/themes/original/index.tsx +165 -0
  25. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  26. package/themes/original/src/components/AddressList/index.tsx +28 -2
  27. package/themes/original/src/components/AppleLogin/index.tsx +118 -77
  28. package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
  29. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
  30. package/themes/original/src/components/BusinessController/index.tsx +28 -9
  31. package/themes/original/src/components/BusinessController/styles.tsx +22 -0
  32. package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
  33. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
  34. package/themes/original/src/components/BusinessListingSearch/index.tsx +4 -0
  35. package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
  36. package/themes/original/src/components/BusinessPreorder/index.tsx +141 -121
  37. package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
  38. package/themes/original/src/components/BusinessProductsList/index.tsx +126 -21
  39. package/themes/original/src/components/BusinessProductsList/styles.tsx +32 -2
  40. package/themes/original/src/components/BusinessProductsListing/index.tsx +12 -5
  41. package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
  42. package/themes/original/src/components/BusinessesListing/index.tsx +1 -2
  43. package/themes/original/src/components/Cart/index.tsx +1 -3
  44. package/themes/original/src/components/CartContent/index.tsx +2 -2
  45. package/themes/original/src/components/Checkout/index.tsx +2 -1
  46. package/themes/original/src/components/Home/index.tsx +1 -1
  47. package/themes/original/src/components/LoginForm/index.tsx +73 -2
  48. package/themes/original/src/components/LoginForm/styles.tsx +6 -1
  49. package/themes/original/src/components/LogoutButton/index.tsx +7 -1
  50. package/themes/original/src/components/Messages/index.tsx +5 -0
  51. package/themes/original/src/components/Messages/styles.tsx +1 -3
  52. package/themes/original/src/components/MomentOption/index.tsx +10 -1
  53. package/themes/original/src/components/MomentOption/styles.tsx +1 -1
  54. package/themes/original/src/components/OrderDetails/index.tsx +1 -3
  55. package/themes/original/src/components/OrderProgress/index.tsx +3 -3
  56. package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
  57. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  58. package/themes/original/src/components/PaymentOptionWallet/index.tsx +6 -2
  59. package/themes/original/src/components/PaymentOptions/index.tsx +3 -1
  60. package/themes/original/src/components/PhoneInputNumber/index.tsx +10 -4
  61. package/themes/original/src/components/PreviousOrders/index.tsx +14 -12
  62. package/themes/original/src/components/ProductForm/index.tsx +4 -4
  63. package/themes/original/src/components/Promotions/index.tsx +232 -0
  64. package/themes/original/src/components/Promotions/styles.tsx +80 -0
  65. package/themes/original/src/components/SignupForm/index.tsx +109 -13
  66. package/themes/original/src/components/SingleProductCard/index.tsx +39 -18
  67. package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
  68. package/themes/original/src/components/TaxInformation/index.tsx +10 -4
  69. package/themes/original/src/components/UserFormDetails/index.tsx +13 -2
  70. package/themes/original/src/components/UserProfile/index.tsx +53 -8
  71. package/themes/original/src/components/Wallets/index.tsx +57 -3
  72. package/themes/original/src/components/Wallets/styles.tsx +21 -0
  73. package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
  74. package/themes/original/src/components/shared/index.tsx +2 -0
  75. package/themes/original/src/config/constants.tsx +6 -6
  76. package/themes/original/src/types/index.tsx +21 -1
  77. package/themes/original/src/utils/index.tsx +9 -0
  78. package/themes/single-business/src/components/AddressList/index.tsx +1 -1
  79. package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
@@ -61,7 +61,6 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
61
61
  handleChangeSearch,
62
62
  businessId
63
63
  } = props;
64
-
65
64
  const theme = useTheme();
66
65
  const isFocused = useIsFocused();
67
66
  const appState = useRef(AppState.currentState)
@@ -318,7 +317,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
318
317
  {
319
318
  !businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
320
319
  <FeaturedWrapper>
321
- <OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('FEATURED_BUSINESS', 'Featured business')}</OText>
320
+ <OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('BUSINESS_FEATURE', 'Featured business')}</OText>
322
321
  <ScrollView
323
322
  showsHorizontalScrollIndicator={false}
324
323
  nestedScrollEnabled
@@ -255,7 +255,7 @@ const CartUI = (props: any) => {
255
255
  <OSRow>
256
256
  <OText size={12} lineHeight={18} numberOfLines={1}>
257
257
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
258
- ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
258
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
259
259
  </OText>
260
260
  <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })} >
261
261
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
@@ -446,8 +446,6 @@ const CartUI = (props: any) => {
446
446
  open={openTaxModal.open}
447
447
  onClose={() => setOpenTaxModal({ open: false, data: null, type: '' })}
448
448
  entireModal
449
- title={`${openTaxModal.data?.name ||
450
- t('INHERIT_FROM_BUSINESS', 'Inherit from business')} ${openTaxModal.data?.rate_type !== 2 ? `(${typeof openTaxModal.data?.rate === 'number' ? `${openTaxModal.data?.rate}%` : `${parsePrice(openTaxModal.data?.fixed ?? 0)} + ${openTaxModal.data?.percentage}%`})` : ''} `}
451
449
  >
452
450
  <TaxInformation
453
451
  type={openTaxModal.type}
@@ -22,9 +22,9 @@ export const CartContent = (props: any) => {
22
22
  <CCContainer>
23
23
  {isOrderStateCarts && carts?.length > 0 && (
24
24
  <>
25
- <OText size={24} lineHeight={36} weight={'600'} style={{ marginBottom: 20 }}>
25
+ {/* <OText size={24} lineHeight={36} weight={'600'} style={{ marginBottom: 20 }}>
26
26
  {carts.length > 1 ? t('MY_CARTS', 'My Carts') : t('CART', 'Cart')}
27
- </OText>
27
+ </OText> */}
28
28
  {carts.map((cart: any, i: number) => (
29
29
  <CCList key={i} style={{ overflow: 'visible' }}>
30
30
  {cart.products.length > 0 && (
@@ -554,11 +554,12 @@ const CheckoutUI = (props: any) => {
554
554
  </ChSection>
555
555
  )}
556
556
 
557
- {!cartState.loading && cart && isWalletEnabled && (
557
+ {!cartState.loading && cart && isWalletEnabled && businessDetails?.business?.configs && (
558
558
  <WalletPaymentOptionContainer>
559
559
  <PaymentOptionWallet
560
560
  cart={cart}
561
561
  businessId={cart?.business_id}
562
+ businessConfigs={businessDetails?.business?.configs}
562
563
  />
563
564
  </WalletPaymentOptionContainer>
564
565
  )}
@@ -36,7 +36,7 @@ export const Home = (props: any) => {
36
36
  {t('WELCOME', 'Welcome!')}
37
37
  </OText>
38
38
  <OText color={theme.colors.white} size={14} style={{ marginBottom: 46 }}>
39
- {t('LETS_START_ORDER', "Let's start to order now")}
39
+ {t('SUBTITLE_HOME', "Let's start to order now")}
40
40
  </OText>
41
41
  <OButton
42
42
  text={t('LOGIN_NOW', 'Login now')}
@@ -4,6 +4,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
4
4
  import { useForm, Controller } from 'react-hook-form';
5
5
  import { PhoneInputNumber } from '../PhoneInputNumber';
6
6
  import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
7
+ import Recaptcha from 'react-native-recaptcha-that-works'
7
8
 
8
9
  import {
9
10
  LoginForm as LoginFormController,
@@ -18,7 +19,6 @@ import { FacebookLogin } from '../FacebookLogin';
18
19
  import { VerifyPhone } from '../../../../../src/components/VerifyPhone';
19
20
  import { OModal } from '../../../../../src/components/shared';
20
21
 
21
-
22
22
  import {
23
23
  Container,
24
24
  ButtonsWrapper,
@@ -32,6 +32,7 @@ import {
32
32
  LineSeparator,
33
33
  SkeletonWrapper,
34
34
  TabBtn,
35
+ RecaptchaButton
35
36
  } from './styles';
36
37
 
37
38
  import NavBar from '../NavBar';
@@ -60,7 +61,9 @@ const LoginFormUI = (props: LoginParams) => {
60
61
  handleSendVerifyCode,
61
62
  handleCheckPhoneCode,
62
63
  onNavigationRedirect,
63
- notificationState
64
+ notificationState,
65
+ handleReCaptcha,
66
+ enableReCaptcha
64
67
  } = props;
65
68
 
66
69
  const [, { showToast }] = useToast();
@@ -79,6 +82,8 @@ const LoginFormUI = (props: LoginParams) => {
79
82
  cellphone: null,
80
83
  },
81
84
  });
85
+ const [recaptchaConfig, setRecaptchaConfig] = useState<any>({})
86
+ const [recaptchaVerified, setRecaptchaVerified] = useState(false)
82
87
 
83
88
  const theme = useTheme();
84
89
 
@@ -100,10 +105,15 @@ const LoginFormUI = (props: LoginParams) => {
100
105
  flexGrow: 1,
101
106
  marginBottom: 7,
102
107
  },
108
+ recaptchaIcon: {
109
+ width: 100,
110
+ height: 100,
111
+ }
103
112
  });
104
113
 
105
114
  const emailRef = useRef<any>({});
106
115
  const passwordRef = useRef<any>({});
116
+ const recaptchaRef = useRef<any>({});
107
117
 
108
118
  const handleChangeTab = (val: string) => {
109
119
  props.handleChangeTab(val);
@@ -156,6 +166,33 @@ const LoginFormUI = (props: LoginParams) => {
156
166
  onChange(value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, ''));
157
167
  };
158
168
 
169
+ const handleOpenRecaptcha = () => {
170
+ setRecaptchaVerified(false)
171
+ if (!recaptchaConfig?.siteKey) {
172
+ showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
173
+ return
174
+ }
175
+ if (!recaptchaConfig?.baseUrl) {
176
+ showToast(ToastType.Error, t('NO_RECAPTCHA_BASE_URL', 'The config doesn\'t have recaptcha base url'));
177
+ return
178
+ }
179
+ recaptchaRef.current.open()
180
+ }
181
+
182
+ const onRecaptchaVerify = (token: any) => {
183
+ setRecaptchaVerified(true)
184
+ handleReCaptcha(token)
185
+ }
186
+
187
+ useEffect(() => {
188
+ if (configs && Object.keys(configs).length > 0 && enableReCaptcha) {
189
+ setRecaptchaConfig({
190
+ siteKey: configs?.security_recaptcha_site_key?.value || null,
191
+ baseUrl: configs?.security_recaptcha_base_url?.value || null
192
+ })
193
+ }
194
+ }, [configs, enableReCaptcha])
195
+
159
196
  useEffect(() => {
160
197
  if (!formState.loading && formState.result?.error) {
161
198
  formState.result?.result &&
@@ -399,6 +436,39 @@ const LoginFormUI = (props: LoginParams) => {
399
436
  </OText>
400
437
  </TouchableOpacity>
401
438
  )}
439
+
440
+ {enableReCaptcha && (
441
+ <>
442
+ <TouchableOpacity
443
+ onPress={handleOpenRecaptcha}
444
+ >
445
+ <RecaptchaButton>
446
+ {recaptchaVerified ? (
447
+ <MaterialCommunityIcons
448
+ name="checkbox-marked"
449
+ size={26}
450
+ color={theme.colors.primary}
451
+ />
452
+ ) : (
453
+ <MaterialCommunityIcons
454
+ name="checkbox-blank-outline"
455
+ size={26}
456
+ color={theme.colors.mediumGray}
457
+ />
458
+ )}
459
+ <OText size={14} mLeft={8}>{t('VERIFY_ReCAPTCHA', 'Verify reCAPTCHA')}</OText>
460
+ </RecaptchaButton>
461
+ </TouchableOpacity>
462
+ <Recaptcha
463
+ ref={recaptchaRef}
464
+ siteKey={recaptchaConfig?.siteKey}
465
+ baseUrl={recaptchaConfig?.baseUrl}
466
+ onVerify={onRecaptchaVerify}
467
+ onExpire={() => setRecaptchaVerified(false)}
468
+ />
469
+ </>
470
+ )}
471
+
402
472
  <OButton
403
473
  onClick={handleSubmit(onSubmit)}
404
474
  text={loginButtonText}
@@ -559,6 +629,7 @@ const LoginFormUI = (props: LoginParams) => {
559
629
  export const LoginForm = (props: any) => {
560
630
  const loginProps = {
561
631
  ...props,
632
+ isRecaptchaEnable: true,
562
633
  UIComponent: LoginFormUI,
563
634
  };
564
635
  return <LoginFormController {...loginProps} />;
@@ -36,7 +36,7 @@ export const LoginWith = styled.View`
36
36
  width: 100%;
37
37
  align-items: flex-start;
38
38
  border-bottom-width: 1px;
39
- border-bottom-color: ${(props: any) => props.theme.colors.border}
39
+ border-bottom-color: ${(props: any) => props.theme.colors.border};
40
40
  `;
41
41
 
42
42
  export const FormInput = styled.View`
@@ -80,3 +80,8 @@ export const LineSeparator = styled.View`
80
80
  export const SkeletonWrapper = styled.View`
81
81
  width: 90%;
82
82
  `
83
+ export const RecaptchaButton = styled.View`
84
+ flex-direction: row;
85
+ align-items: center;
86
+ margin-bottom: 10px;
87
+ `
@@ -3,14 +3,20 @@ import { TouchableOpacity } from 'react-native';
3
3
  import { LogoutAction } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { OIcon, OText } from '../shared';
6
+ import { _retrieveStoreData } from '../../providers/StoreUtil';
6
7
 
7
8
  const LogoutButtonUI = (props: any) => {
8
9
  const { handleLogoutClick, text, color, iconSize } = props
9
10
  const theme = useTheme();
10
11
 
12
+ const handleClick = async () => {
13
+ const data = await _retrieveStoreData('notification_state');
14
+ handleLogoutClick(data)
15
+ };
16
+
11
17
  return (
12
18
  <TouchableOpacity
13
- onPress={() => handleLogoutClick()}
19
+ onPress={() => handleClick()}
14
20
  style={{ flexDirection: 'row', alignItems: 'center' }}
15
21
  >
16
22
  <OIcon
@@ -540,6 +540,11 @@ const styles = StyleSheet.create({
540
540
 
541
541
  export const Messages = (props: MessagesParams) => {
542
542
  const [allMessages, setAllMessages] = useState(props.messages)
543
+
544
+ useEffect(() => {
545
+ setAllMessages(props.messages)
546
+ }, [props.messages])
547
+
543
548
  const MessagesProps = {
544
549
  ...props,
545
550
  UIComponent: MessagesUI,
@@ -1,7 +1,5 @@
1
-
2
1
  import styled, { css } from 'styled-components/native'
3
2
 
4
-
5
3
  export const Wrapper = styled.View`
6
4
  flex: 1;
7
5
  background-color: ${(props: any) => props.theme.colors.white};
@@ -39,4 +37,4 @@ export const MessageTypeItem = styled.View`
39
37
  ${({ active }: any) => active && css`
40
38
  background-color: ${(props: any) => props.theme.colors.whiteGray};
41
39
  `}
42
- `
40
+ `
@@ -4,6 +4,7 @@ import CalendarStrip from 'react-native-calendar-strip'
4
4
  import {
5
5
  useLanguage,
6
6
  useConfig,
7
+ useUtils,
7
8
  useOrder,
8
9
  MomentOption as MomentOptionController,
9
10
  } from 'ordering-components/native';
@@ -132,6 +133,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
132
133
 
133
134
  const [, t] = useLanguage();
134
135
  const [{ configs }] = useConfig();
136
+ const [{ parseTime }] = useUtils()
135
137
  const [orderState] = useOrder();
136
138
  const [optionSelected, setOptionSelected] = useState({
137
139
  isAsap: false,
@@ -143,6 +145,8 @@ const MomentOptionUI = (props: MomentOptionParams) => {
143
145
  });
144
146
  const { bottom } = useSafeAreaInsets();
145
147
 
148
+ const is12hours = configs?.dates_moment_format?.value?.includes('hh:mm')
149
+
146
150
  const [selectedTime, setSelectedTime] = useState(null);
147
151
  const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
148
152
  const [selectDate, setSelectedDate] = useState<any>(null)
@@ -338,7 +342,12 @@ const MomentOptionUI = (props: MomentOptionParams) => {
338
342
  style={{
339
343
  lineHeight: 24
340
344
  }}
341
- >{time.startTime}</OText>
345
+ >{is12hours ? (
346
+ time.startTime.includes('12')
347
+ ? `${time.startTime}PM`
348
+ : parseTime(moment(time.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
349
+ ) : time.startTime
350
+ }</OText>
342
351
  </TimeItem>
343
352
  </TouchableOpacity>
344
353
  ))}
@@ -18,7 +18,7 @@ export const OrderTimeWrapper = styled.View`
18
18
 
19
19
  export const TimeListWrapper = styled.ScrollView`
20
20
  margin-top: 30px;
21
- max-height: 160px;
21
+ max-height: 210px;
22
22
  `
23
23
 
24
24
  export const TimeContentWrapper = styled.View`
@@ -898,7 +898,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
898
898
  <OSRow>
899
899
  <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
900
900
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
901
- ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
901
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
902
902
  </OText>
903
903
  <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })}>
904
904
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
@@ -1025,8 +1025,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
1025
1025
  open={openTaxModal.open}
1026
1026
  onClose={() => setOpenTaxModal({ open: false, data: null, type: '' })}
1027
1027
  entireModal
1028
- title={`${openTaxModal.data?.name ||
1029
- t('INHERIT_FROM_BUSINESS', 'Inherit from business')} ${openTaxModal.data?.rate_type !== 2 ? `(${typeof openTaxModal.data?.rate === 'number' ? `${openTaxModal.data?.rate}%` : `${parsePrice(openTaxModal.data?.fixed ?? 0)} + ${openTaxModal.data?.percentage}%`})` : ''} `}
1030
1028
  >
1031
1029
  <TaxInformation
1032
1030
  type={openTaxModal.type}
@@ -98,7 +98,7 @@ const OrderProgressUI = (props: any) => {
98
98
  { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS || 'Customer almost arrived to business'), slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', percentage: 90 },
99
99
  { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business'), slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS', percentage: 95 },
100
100
  { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', theme?.defaultLanguages?.ORDER_LOOKING_FOR_DRIVER || 'Looking for driver'), slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 35 },
101
- { key: 23, value: t('ORDER_DRIVER_ON_WAY', theme?.defaultLanguages?.ORDER_DRIVER_ON_WAY || 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45 }
101
+ { key: 23, value: t('ORDER_DRIVER_ON_WAY', theme?.defaultLanguages?.ORDER_DRIVER_ON_WAY || 'Driver on way'), slug: 'ORDER_DRIVER_ON_WAY', percentage: 45 }
102
102
  ]
103
103
 
104
104
  const objectStatus = orderStatus.find((o) => o.key === status)
@@ -131,7 +131,7 @@ const OrderProgressUI = (props: any) => {
131
131
 
132
132
  useEffect(() => {
133
133
  if (isFocused) {
134
- loadOrders()
134
+ loadOrders(false, false, false, true)
135
135
  }
136
136
  }, [isFocused])
137
137
 
@@ -188,7 +188,7 @@ const OrderProgressUI = (props: any) => {
188
188
  <ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${getOrderStatus(lastOrder.status)?.percentage}%` : '0%' }} />
189
189
  </ProgressContentWrapper>
190
190
  <ProgressTextWrapper>
191
- <OText size={12}>{getOrderStatus(lastOrder.status)?.value}</OText>
191
+ <OText size={12} style={{ width: '50%' }}>{getOrderStatus(lastOrder.status)?.value}</OText>
192
192
  <TimeWrapper>
193
193
  <OText size={11}>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}</OText>
194
194
  <OText size={11}>
@@ -20,6 +20,7 @@ export const ProgressTextWrapper = styled.View`
20
20
  flex-direction: row;
21
21
  justify-content: space-between;
22
22
  align-items: center;
23
+ width: 100%;
23
24
  `
24
25
 
25
26
  export const OrderInfoWrapper = styled.View`
@@ -112,7 +112,7 @@ const OrderSummaryUI = (props: any) => {
112
112
  {cart?.products?.length > 0 && (
113
113
  <>
114
114
  <OSProductList>
115
- {cart?.products.map((product: any) => (
115
+ {cart?.products?.map((product: any) => (
116
116
  <ProductItemAccordion
117
117
  key={product.code}
118
118
  product={product}
@@ -202,7 +202,7 @@ const OrderSummaryUI = (props: any) => {
202
202
  <OSRow>
203
203
  <OText size={12} numberOfLines={1}>
204
204
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
205
- ({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
205
+ ({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%)
206
206
  </OText>
207
207
  <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })} >
208
208
  <AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
@@ -20,6 +20,7 @@ import { OText } from '../shared'
20
20
 
21
21
  const PaymentOptionWalletUI = (props: any) => {
22
22
  const {
23
+ businessConfigs,
23
24
  businessId,
24
25
  walletsState,
25
26
  selectWallet,
@@ -37,6 +38,9 @@ const PaymentOptionWalletUI = (props: any) => {
37
38
  const isWalletCashEnabled = configs?.wallet_cash_enabled?.value === '1'
38
39
  const isWalletPointsEnabled = configs?.wallet_credit_point_enabled?.value === '1'
39
40
 
41
+ const isBusinessWalletCashEnabled = businessConfigs.find((config: any) => config.key === 'wallet_cash_enabled')?.value === '1'
42
+ const isBusinessWalletPointsEnabled = businessConfigs.find((config: any) => config.key === 'wallet_credit_point_enabled')?.value === '1'
43
+
40
44
  const styles = StyleSheet.create({
41
45
  checkBoxStyle: {
42
46
  width: 25,
@@ -53,11 +57,11 @@ const PaymentOptionWalletUI = (props: any) => {
53
57
  const walletName: any = {
54
58
  cash: {
55
59
  name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
56
- isActive: isWalletCashEnabled
60
+ isActive: isWalletCashEnabled && isBusinessWalletCashEnabled
57
61
  },
58
62
  credit_point: {
59
63
  name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
60
- isActive: isWalletPointsEnabled
64
+ isActive: isWalletPointsEnabled && isBusinessWalletPointsEnabled
61
65
  }
62
66
  }
63
67
 
@@ -126,7 +126,9 @@ const PaymentOptionsUI = (props: any) => {
126
126
 
127
127
  useEffect(() => {
128
128
  if (props.paySelected && props.paySelected?.data) {
129
- setPaymethodData && setPaymethodData(props.paySelected?.data)
129
+ requestAnimationFrame(() => {
130
+ setPaymethodData && setPaymethodData(props.paySelected?.data)
131
+ })
130
132
  }
131
133
  }, [props.paySelected])
132
134
 
@@ -22,8 +22,9 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
22
22
  textStyle,
23
23
  flagStyle,
24
24
  noDropIcon,
25
- isDisabled,
26
- isStartValidation
25
+ isDisabled,
26
+ isStartValidation,
27
+ changeCountry
27
28
  } = props
28
29
 
29
30
  const theme = useTheme();
@@ -106,11 +107,16 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
106
107
  )}
107
108
  <PhoneInput
108
109
  ref={phoneInput}
109
- disabled={isDisabled}
110
+ disabled={isDisabled}
110
111
  defaultValue={userphoneNumber || defaultValue}
111
- defaultCode={defaultCode ? transformCountryCode(defaultCode) : configs?.default_country_code?.value}
112
+ defaultCode={defaultCode ?
113
+ !isNaN(defaultCode)
114
+ ? transformCountryCode(defaultCode)
115
+ : defaultCode
116
+ : configs?.default_country_code?.value}
112
117
  onChangeFormattedText={(text: string) => handleChangeNumber(text)}
113
118
  withDarkTheme
119
+ onChangeCountry={(country) => changeCountry?.(country)}
114
120
  countryPickerProps={{ withAlphaFilter: true }}
115
121
  textContainerStyle={{ ...style.input, ...inputStyle ? inputStyle : {} }}
116
122
  textInputStyle={textStyle}
@@ -143,18 +143,20 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
143
143
  </OText>
144
144
  </Information>
145
145
  <Status>
146
- <OButton
147
- text={t('REORDER', 'Reorder')}
148
- imgRightSrc={''}
149
- textStyle={styles.buttonText}
150
- style={
151
- reorderLoading && order.id === reorderSelected
152
- ? styles.reorderLoading
153
- : styles.reorderbutton
154
- }
155
- onClick={() => handleReorderClick(order.id)}
156
- isLoading={reorderLoading && order.id === reorderSelected}
157
- />
146
+ {order.cart && (
147
+ <OButton
148
+ text={t('REORDER', 'Reorder')}
149
+ imgRightSrc={''}
150
+ textStyle={styles.buttonText}
151
+ style={
152
+ reorderLoading && order.id === reorderSelected
153
+ ? styles.reorderLoading
154
+ : styles.reorderbutton
155
+ }
156
+ onClick={() => handleReorderClick(order.id)}
157
+ isLoading={reorderLoading && order.id === reorderSelected}
158
+ />
159
+ )}
158
160
  {allowedOrderStatus.includes(parseInt(order?.status)) &&
159
161
  !order.review && (
160
162
  <TouchableOpacity
@@ -695,7 +695,7 @@ export const ProductOptionsUI = (props: any) => {
695
695
  </View>
696
696
  )}
697
697
  {product?.extras.map((extra: any) =>
698
- extra.options.map((option: any) => {
698
+ extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
699
699
  const currentState =
700
700
  productCart.options[`id:${option.id}`] || {};
701
701
  return (
@@ -711,7 +711,7 @@ export const ProductOptionsUI = (props: any) => {
711
711
  backgroundColor: isError(option.id),
712
712
  borderRadius: 7.6
713
713
  }}>
714
- {option.suboptions.map(
714
+ {option.suboptions.sort((a: any, b: any) => a.rank - b.rank).map(
715
715
  (suboption: any) => {
716
716
  const currentState =
717
717
  productCart.options[
@@ -779,7 +779,7 @@ export const ProductOptionsUI = (props: any) => {
779
779
  ) : (
780
780
  <>
781
781
  {product?.extras.map((extra: any) =>
782
- extra.options.map((option: any) => {
782
+ extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
783
783
  if (
784
784
  option.id == selOpt ||
785
785
  (hasRespected(
@@ -804,7 +804,7 @@ export const ProductOptionsUI = (props: any) => {
804
804
  option.id,
805
805
  ),
806
806
  }}>
807
- {option.suboptions.map(
807
+ {option.suboptions.sort((a: any, b: any) => a.rank - b.rank).map(
808
808
  (suboption: any) => {
809
809
  const currentState =
810
810
  productCart.options[