ordering-ui-react-native 0.22.74 → 0.22.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.22.74",
3
+ "version": "0.22.76",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -412,9 +412,9 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
412
412
  ordersStoraged[status] = await _retrieveStoreData(`${status}_orders`) ?? []
413
413
  }
414
414
 
415
- if (!_combineTabs && combineTabs) {
416
- setCombineTabsState(combineTabs)
417
- _setStoreData('combine_pending_and_progress_orders', combineTabs);
415
+ if (_combineTabs || !_combineTabs && combineTabs) {
416
+ _combineTabs && setCombineTabsState(_combineTabs)
417
+ _setStoreData('combine_pending_and_progress_orders', _combineTabs || combineTabs);
418
418
  }
419
419
 
420
420
  if (!lastConnection) {
@@ -457,10 +457,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
457
457
  }
458
458
  }, [isNetConnected]);
459
459
 
460
- useEffect(() => {
461
- setCombineTabsState(combineTabs)
462
- }, [combineTabs])
463
-
464
460
  return (
465
461
  <>
466
462
  <View style={styles.header}>
@@ -1032,7 +1028,10 @@ export const OrdersOption = (props: OrdersOptionParams) => {
1032
1028
  const [, t] = useLanguage();
1033
1029
  const [configState] = useConfig()
1034
1030
  const [checkNotificationStatus, setCheckNotificationStatus] = useState({ open: false, checked: false })
1035
- const combineTabs = configState?.configs?.combine_pending_and_progress_orders?.value === '1'
1031
+
1032
+ const getCombineTabsStoraged = async () => await _retrieveStoreData('combine_pending_and_progress_orders')
1033
+ const combineTabs = configState?.configs?.combine_pending_and_progress_orders?.value === '1' || getCombineTabsStoraged()
1034
+
1036
1035
  const ordersProps = {
1037
1036
  ...props,
1038
1037
  UIComponent: OrdersOptionUI,
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useRef, useEffect } from 'react';
2
- import { TouchableOpacity, View } from 'react-native';
2
+ import { TouchableOpacity, View, Vibration } from 'react-native';
3
3
  import { useOrder, useLanguage, useUtils, useConfig, useEvent } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import {
@@ -69,6 +69,11 @@ export const BusinessItemAccordion = (props: any) => {
69
69
  }
70
70
  }, [isActive, viewedCart])
71
71
 
72
+ const handleGoToStore = () => {
73
+ Vibration.vibrate(100)
74
+ props.onNavigationRedirect('Business', { store: cart?.business?.slug })
75
+ }
76
+
72
77
  return (
73
78
  <BIContainer isClosed={isClosed} isMultiCheckout={isMultiCheckout} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
74
79
  <BIHeader
@@ -82,7 +87,7 @@ export const BusinessItemAccordion = (props: any) => {
82
87
  <View style={{ flexDirection: 'row' }}>
83
88
  {props.onNavigationRedirect && !isClosed && !isGiftCart && (
84
89
  <>
85
- <TouchableOpacity onPress={() => props.onNavigationRedirect('Business', { store: cart?.business?.slug })}>
90
+ <TouchableOpacity onPress={() => handleGoToStore()}>
86
91
  <OText color={theme.colors.primary} size={12} lineHeight={18} style={{ textDecorationLine: 'underline' }}>{t('GO_TO_STORE', 'Go to store')}</OText>
87
92
  </TouchableOpacity>
88
93
  </>
@@ -114,6 +114,7 @@ const CartUI = (props: any) => {
114
114
  }
115
115
 
116
116
  const handleUpsellingPage = (individualCart: any) => {
117
+ Vibration.vibrate(100)
117
118
  const isProductCartParam = !!individualCart?.products?.length
118
119
  setOpenUpselling(false)
119
120
  setCanOpenUpselling(false)
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { Platform, StyleSheet, View } from 'react-native'
2
+ import { Platform, StyleSheet, View, Vibration } from 'react-native'
3
3
  import {
4
4
  useLanguage,
5
5
  useOrder,
@@ -90,6 +90,11 @@ export const UpsellingContent = (props: any) => {
90
90
  setShowTitle(contentOffset.y > 30)
91
91
  }
92
92
 
93
+ const handleClickCheckout = () => {
94
+ Vibration.vibrate(100)
95
+ handleUpsellingPage(cart)
96
+ }
97
+
93
98
  return (
94
99
  <>
95
100
  <View style={styles.wrapperNavbar}>
@@ -160,7 +165,7 @@ export const UpsellingContent = (props: any) => {
160
165
  text={t('CHECKOUT', 'Checkout')}
161
166
  textStyle={{ fontSize: 14 }}
162
167
  style={{ ...styles.closeUpsellingButton }}
163
- onClick={() => handleUpsellingPage(cart)}
168
+ onClick={() => handleClickCheckout()}
164
169
  />
165
170
  </View>
166
171
  </>