Skip to content

Commit a7650d9

Browse files
committed
Don't show the affected routes warning when there is only one route
The typical case, that is.
1 parent 127d290 commit a7650d9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Diff for: ui/src/components/timetables/common/ChangeTimetablesValidityForm.tsx

+12-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useRef } from 'react';
33
import { FormProvider, useForm } from 'react-hook-form';
44
import { useTranslation } from 'react-i18next';
55
import { z } from 'zod';
6-
import { Row } from '../../../layoutComponents';
6+
import { Row, Visible } from '../../../layoutComponents';
77
import { SimpleButton } from '../../../uiComponents';
88
import { submitFormByRef } from '../../../utils';
99
import {
@@ -81,16 +81,18 @@ export const ChangeTimetablesValidityForm = ({
8181
/>
8282
</FormRow>
8383
</FormColumn>
84-
<div className="my-6 flex flex-row items-center space-x-6">
85-
<i className="icon-alert text-hsl-red" />
86-
<div className="space-y-1 text-sm">
87-
<p className="font-bold">
88-
{t('changeTimetablesValidityModal.noticeChangesInRoutes')}
89-
</p>
90-
<p>{affectedRouteLabels.join(', ')}</p>
84+
<Visible visible={affectedRouteLabels.length > 1}>
85+
<div className="my-6 flex flex-row items-center space-x-6">
86+
<i className="icon-alert text-hsl-red" />
87+
<div className="space-y-1 text-sm">
88+
<p className="font-bold">
89+
{t('changeTimetablesValidityModal.noticeChangesInRoutes')}
90+
</p>
91+
<p>{affectedRouteLabels.join(', ')}</p>
92+
</div>
9193
</div>
92-
</div>
93-
<Row className="justify-end space-x-4">
94+
</Visible>
95+
<Row className="mt-6 justify-end space-x-4">
9496
<SimpleButton onClick={onCancel} inverted>
9597
{t('cancel')}
9698
</SimpleButton>

0 commit comments

Comments
 (0)