@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.
- package/Step5/Payments/Payments.tsx +7 -0
- package/Step5/Step5.tsx +3 -3
- package/package.json +1 -1
- package/types.ts +1 -0
|
@@ -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