@autobusal/routes-order 1.40.3 → 1.41.0
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/Checkout/Checkout.tsx
CHANGED
|
@@ -445,19 +445,24 @@ const Checkout = ({ values, step1, step2, step3, isPartner, t, onStore, onBack }
|
|
|
445
445
|
* collected or undefined, so a failure stops the chain with the offending
|
|
446
446
|
* form's own error messages already on screen.
|
|
447
447
|
*/
|
|
448
|
+
const [ payNotice, setPayNotice ] = useState<string | null>(null);
|
|
449
|
+
|
|
448
450
|
const onPay = async (): Promise<void> => {
|
|
451
|
+
// Claude - 2026-11-05: under the Pay button, in the site's own look (they were alert()s)
|
|
449
452
|
if (action === undefined) {
|
|
450
|
-
|
|
453
|
+
setPayNotice(t('routes_order.step5.choose_payment'));
|
|
451
454
|
|
|
452
455
|
return;
|
|
453
456
|
}
|
|
454
457
|
|
|
455
458
|
if (addonWhatsapp && addonWhatsappNumber.trim().length < 5) {
|
|
456
|
-
|
|
459
|
+
setPayNotice(t('routes_order.step5.addons.whatsapp.phone_error'));
|
|
457
460
|
|
|
458
461
|
return;
|
|
459
462
|
}
|
|
460
463
|
|
|
464
|
+
setPayNotice(null);
|
|
465
|
+
|
|
461
466
|
let person: PersonData | undefined;
|
|
462
467
|
|
|
463
468
|
await passenger.handleSubmit((data) => { person = data; })();
|
|
@@ -650,6 +655,7 @@ const Checkout = ({ values, step1, step2, step3, isPartner, t, onStore, onBack }
|
|
|
650
655
|
pending={ isPending }
|
|
651
656
|
t={ t }
|
|
652
657
|
onPay={ onPay }
|
|
658
|
+
notice={ payNotice }
|
|
653
659
|
payments={ (
|
|
654
660
|
<Payments
|
|
655
661
|
selected={ action ?? '' }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TFunction } from 'i18next';
|
|
2
2
|
import { MdDone } from 'react-icons/md';
|
|
3
3
|
import { AiOutlineInfoCircle } from 'react-icons/ai';
|
|
4
|
-
import { Button } from '@autobusal/common';
|
|
4
|
+
import { Button, FormNotice } from '@autobusal/common';
|
|
5
5
|
import About from '../../Step5/Summary/About/About';
|
|
6
6
|
import Amount from '../../Step5/Summary/Amount/Amount';
|
|
7
7
|
import { Container, Panel, Actions, Notice, Local } from './styles';
|
|
@@ -54,6 +54,8 @@ interface Props {
|
|
|
54
54
|
pending: boolean
|
|
55
55
|
t: TFunction<'common'>
|
|
56
56
|
onPay: () => void
|
|
57
|
+
/* Claude - 2026-11-05: why Pay did not go ahead, said under the button */
|
|
58
|
+
notice?: string | null
|
|
57
59
|
/** coupon form, rendered directly above the totals it affects */
|
|
58
60
|
children?: React.ReactNode
|
|
59
61
|
/** payment-method picker, rendered directly above the button that uses it */
|
|
@@ -70,7 +72,7 @@ interface Props {
|
|
|
70
72
|
* page and scrolled away while add-ons were being ticked - so the number
|
|
71
73
|
* changed out of sight of the person it was changing for.
|
|
72
74
|
*/
|
|
73
|
-
const Sidebar = ({ step1, step2, step3, fare, addons, coupon, total, local, surcharge, comission, action, single, pending, t, onPay, children, payments }: Props): JSX.Element => (
|
|
75
|
+
const Sidebar = ({ step1, step2, step3, fare, addons, coupon, total, local, surcharge, comission, action, single, pending, t, onPay, notice, children, payments }: Props): JSX.Element => (
|
|
74
76
|
<Container>
|
|
75
77
|
<Panel className="box">
|
|
76
78
|
<SubTitle>
|
|
@@ -158,7 +160,7 @@ const Sidebar = ({ step1, step2, step3, fare, addons, coupon, total, local, surc
|
|
|
158
160
|
onClick={ onPay }
|
|
159
161
|
/>
|
|
160
162
|
|
|
161
|
-
{ action === undefined && (
|
|
163
|
+
{ notice ? <FormNotice message={ notice } /> : action === undefined && (
|
|
162
164
|
<Notice>{ t('routes_order.step5.choose_payment') }</Notice>
|
|
163
165
|
) }
|
|
164
166
|
</Actions>
|