File tree Expand file tree Collapse file tree 4 files changed +16
-2
lines changed
routes-and-lines/line-details Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,19 @@ const testIds = {
6
6
} ;
7
7
8
8
type Props = {
9
+ titleName : string ;
9
10
direction : RouteDirectionEnum ;
10
11
className ?: string ;
11
12
} ;
12
13
13
- export const DirectionBadge = ( { direction, className = '' } : Props ) => {
14
+ export const DirectionBadge = ( {
15
+ titleName,
16
+ direction,
17
+ className = '' ,
18
+ } : Props ) => {
14
19
return (
15
20
< span
21
+ title = { titleName }
16
22
className = { `relative flex h-9 w-9 items-center justify-center bg-brand text-2xl font-bold text-white ${ className } ` }
17
23
>
18
24
< span data-testid = { testIds . value } >
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ export const ExpandableRouteRow = ({
69
69
< DirectionBadge
70
70
direction = { route . direction as RouteDirectionEnum }
71
71
className = "mr-4"
72
+ titleName = { t ( `directionEnum.${ route . direction } ` ) }
72
73
/>
73
74
< span className = "text-xl" data-testid = { testIds . label } >
74
75
< RouteLabel label = { route . label } variant = { route . variant } />
Original file line number Diff line number Diff line change
1
+ import { useTranslation } from 'react-i18next' ;
1
2
import { VehicleJourneyWithRouteInfoFragment } from '../../../generated/graphql' ;
2
3
import { useToggle } from '../../../hooks' ;
3
4
import { parseI18nField } from '../../../i18n/utils' ;
@@ -17,6 +18,7 @@ const VehicleJourneyRow = ({
17
18
} : {
18
19
vehicleJourney : VehicleJourneyWithRouteInfoFragment ;
19
20
} ) : JSX . Element => {
21
+ const { t } = useTranslation ( ) ;
20
22
const route =
21
23
vehicleJourney . journey_pattern_ref . journey_pattern_instance
22
24
?. journey_pattern_route ;
@@ -36,6 +38,7 @@ const VehicleJourneyRow = ({
36
38
< DirectionBadge
37
39
direction = { route . direction }
38
40
className = "mr-2 h-5 w-5 text-base"
41
+ titleName = { t ( `directionEnum.${ route . direction } ` ) }
39
42
/>
40
43
{ getRouteLabelVariantText ( route ) }
41
44
</ Row >
Original file line number Diff line number Diff line change @@ -76,7 +76,11 @@ export const RouteTimetablesSection = ({
76
76
< div data-testid = { testIds . timetableSection ( route . label , route . direction ) } >
77
77
< Row >
78
78
< div className = "flex flex-1 items-center bg-background" >
79
- < DirectionBadge direction = { route . direction } className = "my-5 ml-12" />
79
+ < DirectionBadge
80
+ direction = { route . direction }
81
+ className = "my-5 ml-12"
82
+ titleName = { t ( `directionEnum.${ route . direction } ` ) }
83
+ />
80
84
< h3 className = "ml-3.5" >
81
85
< RouteLabel label = { route . label } variant = { route . variant } />
82
86
</ h3 >
You can’t perform that action at this time.
0 commit comments