ordering-ui-react-native 0.22.75 → 0.22.77

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.75",
3
+ "version": "0.22.77",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -546,7 +546,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
546
546
  </View>
547
547
  )}
548
548
  {!((!order || Object.keys(order).length === 0) &&
549
- (props.order?.error?.length < 1 || !props.order?.error)) && (
549
+ (props.order?.error?.length < 1 || !props.order?.error)) && order?.id && (
550
550
  <View style={{ flex: 1 }}>
551
551
  <OrderHeaderComponent
552
552
  order={order}
@@ -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
  </>