@autobusal/routes-order 1.0.1 → 1.1.1

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.
@@ -73,6 +73,13 @@ const Payments = ({ selected, isPartner, t, onChange }: Props): JSX.Element => {
73
73
  { t('routes_order.step5.actions.card') }
74
74
  </ButtonPayment>
75
75
  ) }
76
+
77
+ { (data?.stripe || isPartner) && (
78
+ <ButtonPayment type="button" $selected={ selected === 'stripe' } onClick={ () => onChange('stripe') }>
79
+ <AiOutlineCreditCard />
80
+ { t('routes_order.step5.actions.card') }
81
+ </ButtonPayment>
82
+ ) }
76
83
  </ContainerPayments>
77
84
  </Container>
78
85
  </>
package/Step5/Step5.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { useState } from 'react';
1
+ import { useCallback, useState } from 'react';
2
2
  import { TFunction } from 'i18next';
3
3
  import { useForm } from 'react-hook-form';
4
4
  import { useNavigate } from 'react-router-dom';
@@ -54,9 +54,9 @@ const Step5 = ({ step1, step2, step3, step4, isPartner, t, onBack }: Props): JSX
54
54
  setCoupon(data);
55
55
  };
56
56
 
57
- const onAction = (action: string): void => {
57
+ const onAction = useCallback((action: string): void => {
58
58
  setAction(action);
59
- };
59
+ }, []);
60
60
 
61
61
  const onSendForm = async (): Promise<void> => {
62
62
  await handleSubmit(onSubmit)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/routes-order",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "main": "index.ts"
6
6
  }
package/types.ts CHANGED
@@ -13,6 +13,7 @@ export interface ActionData {
13
13
  reserve: boolean
14
14
  funds: boolean
15
15
  bkt: boolean
16
+ stripe: boolean
16
17
  }
17
18
 
18
19
  export interface SaveData {