ordering-ui-react-native 0.14.40 → 0.14.41

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.14.40",
3
+ "version": "0.14.41",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -510,6 +510,7 @@ const CheckoutUI = (props: any) => {
510
510
  <WalletPaymentOptionContainer>
511
511
  <PaymentOptionWallet
512
512
  cart={cart}
513
+ businessId={cart?.business_id}
513
514
  />
514
515
  </WalletPaymentOptionContainer>
515
516
  )}
@@ -7,6 +7,7 @@ import {
7
7
  PaymentOptionWallet as PaymentOptionWalletController,
8
8
  useLanguage,
9
9
  useUtils,
10
+ useOrder
10
11
  } from 'ordering-components/native'
11
12
 
12
13
  import {
@@ -18,7 +19,7 @@ import { OText } from '../shared'
18
19
 
19
20
  const PaymentOptionWalletUI = (props: any) => {
20
21
  const {
21
- cart,
22
+ businessId,
22
23
  walletsState,
23
24
  selectWallet,
24
25
  deletetWalletSelected
@@ -26,8 +27,11 @@ const PaymentOptionWalletUI = (props: any) => {
26
27
 
27
28
  const theme = useTheme()
28
29
  const [, t] = useLanguage()
30
+ const [{ carts }] = useOrder()
29
31
  const [{ parsePrice }] = useUtils()
30
32
 
33
+ const cart = carts?.[`businessId:${businessId}`] ?? {}
34
+
31
35
  const styles = StyleSheet.create({
32
36
  checkBoxStyle: {
33
37
  width: 25,
@@ -68,7 +72,7 @@ const PaymentOptionWalletUI = (props: any) => {
68
72
  if (!walletsState.loading && walletsState.result?.length) {
69
73
  setCheckedState(
70
74
  walletsState.result?.map((wallet: any) => {
71
- return !!cart?.wallets?.find((w: any) => w.id === wallet.id)
75
+ return !!cart?.payment_events?.find((w: any) => w.wallet_id === wallet.id)
72
76
  })
73
77
  )
74
78
  }