ordering-ui-react-native 0.22.50 → 0.22.51-test1
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 +2 -2
- package/themes/original/src/components/MomentOption/index.tsx +5 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +6 -4
- package/themes/original/src/components/StripeElementsForm/index.tsx +3 -1
- package/themes/original/src/utils/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-react-native",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.51-test1",
|
|
4
4
|
"description": "Reusable components made in react native",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"author": "ordering.inc",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"react-native-color-matrix-image-filters": "^5.2.10",
|
|
77
77
|
"react-native-country-picker-modal": "^2.0.0",
|
|
78
78
|
"react-native-credit-card-input": "^0.4.1",
|
|
79
|
-
"react-native-date-picker": "
|
|
79
|
+
"react-native-date-picker": "4.2.14",
|
|
80
80
|
"react-native-device-info": "^8.7.1",
|
|
81
81
|
"react-native-document-picker": "^5.2.0",
|
|
82
82
|
"react-native-elements": "^3.0.0-alpha.1",
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
TimeItem
|
|
30
30
|
} from './styles';
|
|
31
31
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
32
|
-
import { locale, monthsEnum } from '../../utils';
|
|
32
|
+
import { locale, monthsEnum, setLocalMoment } from '../../utils';
|
|
33
33
|
|
|
34
34
|
const MomentOptionUI = (props: MomentOptionParams) => {
|
|
35
35
|
const {
|
|
@@ -245,6 +245,10 @@ const MomentOptionUI = (props: MomentOptionParams) => {
|
|
|
245
245
|
)
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
+
useEffect(() => {
|
|
249
|
+
setLocalMoment(moment, t)
|
|
250
|
+
}, [])
|
|
251
|
+
|
|
248
252
|
useEffect(() => {
|
|
249
253
|
if (datesList?.length > 0) {
|
|
250
254
|
const _datesList = datesList.slice((cateringPreorder && preorderMinimumDays) || 0, Number(cateringPreorder ? preorderMaximumDays || configs?.max_days_preorder?.value : configs?.max_days_preorder?.value ?? 6))
|
|
@@ -51,7 +51,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
51
51
|
const { confirmApplePayPayment } = useApplePay()
|
|
52
52
|
|
|
53
53
|
const [addCardOpen, setAddCardOpen] = useState({ stripe: false, stripeConnect: false });
|
|
54
|
-
|
|
54
|
+
const [newCardAdded, setNewCardAdded] = useState(null)
|
|
55
55
|
const isWalletCashEnabled = configs?.wallet_cash_enabled?.value === '1'
|
|
56
56
|
const isWalletPointsEnabled = configs?.wallet_credit_point_enabled?.value === '1'
|
|
57
57
|
|
|
@@ -223,6 +223,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
223
223
|
handlePaymethodDataChange={handlePaymethodDataChange}
|
|
224
224
|
clientSecret={props.clientSecret}
|
|
225
225
|
onPaymentChange={handlePaymethodDataChange}
|
|
226
|
+
newCardAdded={newCardAdded}
|
|
226
227
|
/>
|
|
227
228
|
</View>
|
|
228
229
|
)}
|
|
@@ -233,7 +234,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
233
234
|
toSave
|
|
234
235
|
businessId={businessIds[0]}
|
|
235
236
|
businessIds={businessIds}
|
|
236
|
-
businessNames={openCarts?.map?.((cart
|
|
237
|
+
businessNames={openCarts?.map?.((cart: any) => cart?.business?.name)}
|
|
237
238
|
publicKey={paymethodSelected?.data?.publishable}
|
|
238
239
|
requirements={props.clientSecret}
|
|
239
240
|
handleSource={handlePaymethodDataChange}
|
|
@@ -307,7 +308,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
307
308
|
</>
|
|
308
309
|
)}
|
|
309
310
|
|
|
310
|
-
|
|
311
|
+
<OModal
|
|
311
312
|
entireModal
|
|
312
313
|
title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
|
|
313
314
|
open={addCardOpen.stripe}
|
|
@@ -327,10 +328,11 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
327
328
|
publicKey={paymethodSelected?.data?.publishable}
|
|
328
329
|
requirements={props.clientSecret}
|
|
329
330
|
onSelectCard={handlePaymethodDataChange}
|
|
331
|
+
setNewCardAdded={setNewCardAdded}
|
|
330
332
|
onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
|
|
331
333
|
/>
|
|
332
334
|
</KeyboardAvoidingView>
|
|
333
|
-
</OModal>
|
|
335
|
+
</OModal>
|
|
334
336
|
</PMContainer>
|
|
335
337
|
)
|
|
336
338
|
}
|
|
@@ -37,7 +37,8 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
37
37
|
publicKeyAddCard,
|
|
38
38
|
urlScheme,
|
|
39
39
|
androidAppId,
|
|
40
|
-
businessNames
|
|
40
|
+
businessNames,
|
|
41
|
+
setNewCardAdded
|
|
41
42
|
} = props;
|
|
42
43
|
|
|
43
44
|
const theme = useTheme();
|
|
@@ -150,6 +151,7 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
150
151
|
const _isNewCard = index === 0
|
|
151
152
|
stripeTokenHandler(setupIntent?.paymentMethodId, user, businessId, _isNewCard);
|
|
152
153
|
})
|
|
154
|
+
setNewCardAdded(card)
|
|
153
155
|
} else {
|
|
154
156
|
stripeTokenHandler(setupIntent?.paymentMethodId, user, businessId);
|
|
155
157
|
}
|