Skip to content

Commit

Permalink
Add typograph to modal content
Browse files Browse the repository at this point in the history
  • Loading branch information
sashachabin committed Jul 29, 2023
1 parent dfd814c commit 66cb7bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions client/components/Map/Stops/Sidebar/MapStopsSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { IconFont } from 'components/UI/Typography/IconFont/IconFont';
import { StopType } from 'transport-common/types/masstrans';

import styles from './MapStopsSidebar.module.css';
import t from 'utils/typograph';

export type MapStopsSidebarProps = {
type: StopType;
Expand Down Expand Up @@ -53,7 +54,7 @@ export function MapStopsSidebar({ type, name }: MapStopsSidebarProps) {
<IconFont key={t} name={IconFontCharsNames[t]} />
))}
</Typography>
<Typography variant="h3">{name}</Typography>
<Typography variant="h3">{t(name)}</Typography>
</div>
</div>
<Divider />
Expand All @@ -73,11 +74,11 @@ export function MapStopsSidebar({ type, name }: MapStopsSidebarProps) {
backgroundColor: VEHICLE_TYPE_COLORS[vehicle.type],
}}
>
{vehicle.route}
{t(vehicle.route)}
</div>
<div>
<span className={cn(styles.MapStopsSidebarVehicleEndpoint)}>
{vehicle.to}
{t(vehicle.to)}
</span>
{Boolean(vehicle.through.length) && (
<>
Expand Down
13 changes: 7 additions & 6 deletions client/components/Map/Vehicles/Sidebar/MapVehiclesSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import React, { useEffect, useMemo, useState } from 'react';
import L from 'leaflet';
import classNames from 'classnames/bind';
import t from 'utils/typograph';

import {
ClientUnit,
Expand Down Expand Up @@ -395,7 +396,7 @@ export function MapVehiclesSidebar({
<PageText
className={cn(styles.MapVehiclesSidebarStationName)}
>
{stop.title}
{t(stop.title)}
</PageText>
{'arriveTime' in stop && (
<PageText>{stop.arriveTime}</PageText>
Expand Down Expand Up @@ -459,10 +460,10 @@ export function MapVehiclesSidebar({
styles.MapVehiclesSidebarStationName,
)}
>
{stop.title}
{t(stop.title)}
</PageText>
{'arriveTime' in stop && (
<PageText>{stop.arriveTime}</PageText>
<PageText>{t(stop.arriveTime)}</PageText>
)}
</li>
))}
Expand All @@ -480,7 +481,7 @@ export function MapVehiclesSidebar({
<PageText
className={cn(styles.MapVehiclesSidebarStationName)}
>
{endStop.title}
{t(endStop.title)}
</PageText>

{'arriveTime' in endStop && (
Expand Down Expand Up @@ -587,7 +588,7 @@ export function MapVehiclesSidebar({
styles.MapVehiclesSidebarAdditionalTitle,
)}
>
{unitInfo.model}
{t(unitInfo.model)}
</span>
)}
{Boolean(unitInfo.model && unitInfo.factory) && <br />}
Expand All @@ -597,7 +598,7 @@ export function MapVehiclesSidebar({
styles.MapVehiclesSidebarAdditionalSubitle,
)}
>
{unitInfo.factory}
{t(unitInfo.factory)}
</span>
)}
</div>
Expand Down

0 comments on commit 66cb7bd

Please sign in to comment.