ordering-ui-react-native 0.18.63 → 0.18.65
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 +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +1 -1
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +17 -4
- package/themes/original/src/components/MultiCheckout/index.tsx +2 -1
- package/themes/original/src/components/Wallets/index.tsx +7 -3
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
useLanguage, useUtils, RedeemGiftCard as RedeemGiftCardController
|
|
4
4
|
} from 'ordering-components/native'
|
|
@@ -26,6 +26,8 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
26
26
|
const { handleSubmit, control, errors } = useForm()
|
|
27
27
|
const [{ parsePrice }] = useUtils()
|
|
28
28
|
|
|
29
|
+
const [codeValue, setCodeValue] = useState('')
|
|
30
|
+
|
|
29
31
|
const style = StyleSheet.create({
|
|
30
32
|
btnStyle: {
|
|
31
33
|
borderRadius: 7.6,
|
|
@@ -43,6 +45,14 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
43
45
|
handleApply(values)
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
const handleChangeCode = (string: any) => {
|
|
49
|
+
string = string.replace(/-/g, '')
|
|
50
|
+
if (!string) return
|
|
51
|
+
const codeSlices = string.match(/.{1,4}/g)
|
|
52
|
+
string = codeSlices.join('-')
|
|
53
|
+
setCodeValue(string)
|
|
54
|
+
}
|
|
55
|
+
|
|
46
56
|
useEffect(() => {
|
|
47
57
|
if (Object.keys(errors).length > 0) {
|
|
48
58
|
const list = Object.values(errors)
|
|
@@ -90,9 +100,12 @@ const RedeemGiftCardUI = (props: any) => {
|
|
|
90
100
|
control={control}
|
|
91
101
|
render={({ onChange, value }: any) => (
|
|
92
102
|
<OInput
|
|
93
|
-
placeholder='
|
|
94
|
-
value={
|
|
95
|
-
onChange={(val: any) =>
|
|
103
|
+
placeholder='XXXX-XXXX-XXXX-XXXX'
|
|
104
|
+
value={codeValue}
|
|
105
|
+
onChange={(val: any) => {
|
|
106
|
+
onChange(val)
|
|
107
|
+
handleChangeCode(val)
|
|
108
|
+
}}
|
|
96
109
|
autoCapitalize='none'
|
|
97
110
|
autoCorrect={false}
|
|
98
111
|
blurOnSubmit={false}
|
|
@@ -53,7 +53,6 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
53
53
|
navigation,
|
|
54
54
|
placing,
|
|
55
55
|
openCarts,
|
|
56
|
-
totalCartsPrice,
|
|
57
56
|
handleGroupPlaceOrder,
|
|
58
57
|
paymethodSelected,
|
|
59
58
|
handleSelectPaymethod,
|
|
@@ -99,6 +98,8 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
|
|
101
|
+
const totalCartsPrice = cartGroup?.result?.balance
|
|
102
|
+
|
|
102
103
|
const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
|
|
103
104
|
? JSON.parse(configs?.driver_tip_options?.value) || []
|
|
104
105
|
: configs?.driver_tip_options?.value || []
|
|
@@ -260,9 +260,13 @@ const WalletsUI = (props: any) => {
|
|
|
260
260
|
</OText>
|
|
261
261
|
</BalanceElement>
|
|
262
262
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
263
|
+
{currentWalletSelected?.type === 'cash' && (
|
|
264
|
+
<>
|
|
265
|
+
<View style={styles.dividerStyle} />
|
|
266
|
+
<GiftCardUI navigation={navigation} />
|
|
267
|
+
<View style={styles.dividerStyle} />
|
|
268
|
+
</>
|
|
269
|
+
)}
|
|
266
270
|
|
|
267
271
|
{!isChewLayout && (
|
|
268
272
|
<WalletTransactions
|