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
|
@@ -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
|
-
|
|
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?.
|
|
75
|
+
return !!cart?.payment_events?.find((w: any) => w.wallet_id === wallet.id)
|
|
72
76
|
})
|
|
73
77
|
)
|
|
74
78
|
}
|