ordering-ui-react-native 0.17.96 → 0.17.98

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.17.96",
3
+ "version": "0.17.98",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -81,15 +81,15 @@ export const PreviousOrders = (props: any) => {
81
81
  imgRightSrc={null}
82
82
  style={{ borderRadius: 7, height: 40 }}
83
83
  parentStyle={{ width: '100%' }}
84
- textStyle={{ color: theme.colors.primary }}
84
+ textStyle={{ color: theme?.colors?.white }}
85
85
  />
86
86
  ) : (
87
87
  <>
88
88
  <OButton
89
89
  text={t('REJECT', 'Reject')}
90
90
  onClick={() => handleClickLogisticOrder(2, _order?.id)}
91
- bgColor={theme.colors.danger}
92
- borderColor={theme.colors.danger}
91
+ bgColor={theme.colors.red}
92
+ borderColor={theme.colors.red}
93
93
  imgRightSrc={null}
94
94
  style={{ borderRadius: 7, height: 40 }}
95
95
  parentStyle={{ width: '45%' }}
@@ -98,8 +98,8 @@ export const PreviousOrders = (props: any) => {
98
98
  <OButton
99
99
  text={t('ACCEPT', 'Accept')}
100
100
  onClick={() => handleClickLogisticOrder(1, _order?.id)}
101
- bgColor={theme.colors.successOrder}
102
- borderColor={theme.colors.successOrder}
101
+ bgColor={theme.colors.green}
102
+ borderColor={theme.colors.green}
103
103
  imgRightSrc={null}
104
104
  style={{ borderRadius: 7, height: 40 }}
105
105
  parentStyle={{ width: '45%' }}
@@ -108,17 +108,18 @@ const CartUI = (props: any) => {
108
108
  }
109
109
  }
110
110
 
111
- const handleUpsellingPage = () => {
111
+ const handleUpsellingPage = (individualCart : any) => {
112
112
  setOpenUpselling(false)
113
113
  setCanOpenUpselling(false)
114
114
  const cartsAvailable: any = Object.values(orderState?.carts)?.filter((cart: any) => cart?.valid && cart?.status !== 2)
115
- if (cartsAvailable.length === 1) {
115
+ if (cartsAvailable.length === 1 || !isMultiCheckout) {
116
+ const cart = isMultiCheckout ? cartsAvailable[0] : individualCart
116
117
  onNavigationRedirect('CheckoutNavigator', {
117
118
  screen: 'CheckoutPage',
118
- cartUuid: cartsAvailable[0]?.uuid,
119
- businessLogo: cartsAvailable[0]?.business?.logo,
120
- businessName: cartsAvailable[0]?.business?.name,
121
- cartTotal: cartsAvailable[0]?.total
119
+ cartUuid: cart?.uuid,
120
+ businessLogo: cart?.business?.logo,
121
+ businessName: cart?.business?.name,
122
+ cartTotal: cart?.total
122
123
  })
123
124
  } else {
124
125
  const groupKeys: any = {}
@@ -81,7 +81,7 @@ const MultiCheckoutUI = (props: any) => {
81
81
 
82
82
  const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
83
83
  const isPreOrder = configs?.preorder_status_enabled?.value === '1'
84
- const isMultiDriverTips = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
84
+ const isMultiDriverTips = configs?.checkout_multi_business_enabled?.value === '1'
85
85
  const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data)
86
86
  const walletCarts = (Object.values(carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
87
87
  const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
@@ -117,7 +117,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
117
117
  if (upsellingProducts?.products?.length && !isFromCart) {
118
118
  setCanOpenUpselling && setCanOpenUpselling(true)
119
119
  } else {
120
- handleUpsellingPage && handleUpsellingPage()
120
+ handleUpsellingPage && handleUpsellingPage(cart)
121
121
  }
122
122
  }
123
123
  }
@@ -225,7 +225,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
225
225
  style={{ ...styles.closeUpsellingButton }}
226
226
  textStyle={{ color: theme.colors.white, fontSize: 14 }}
227
227
  onClick={() => {
228
- handleUpsellingPage()
228
+ handleUpsellingPage(cart)
229
229
  setIsCheckout(true)
230
230
  }}
231
231
  />
@@ -247,7 +247,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
247
247
  <OBottomPopup
248
248
  title={''}
249
249
  open={openUpselling}
250
- onClose={() => handleUpsellingPage()}
250
+ onClose={() => handleUpsellingPage(cart)}
251
251
  isStatusBar
252
252
  >
253
253
  <UpsellingContent />
@@ -593,7 +593,7 @@ export interface UpsellingProductsParams {
593
593
  business?: any;
594
594
  businessId?: number;
595
595
  cartProducts?: Array<any>;
596
- handleUpsellingPage: () => void;
596
+ handleUpsellingPage: (cart ?: any) => void;
597
597
  openUpselling: boolean;
598
598
  canOpenUpselling?: boolean;
599
599
  setCanOpenUpselling?: (value: any) => void;