ordering-ui-react-native 0.22.50 → 0.22.51

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.22.50",
3
+ "version": "0.22.51",
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": "^4.2.13",
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",
@@ -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 : any) => cart?.business?.name)}
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
- {/* <OModal
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
  }