diff --git a/packages/chaire-lib-frontend/src/components/pageParts/DistanceUnitFormatter.tsx b/packages/chaire-lib-frontend/src/components/pageParts/DistanceUnitFormatter.tsx index 3492ad08..2e19361b 100644 --- a/packages/chaire-lib-frontend/src/components/pageParts/DistanceUnitFormatter.tsx +++ b/packages/chaire-lib-frontend/src/components/pageParts/DistanceUnitFormatter.tsx @@ -21,8 +21,9 @@ export interface DistanceUnitFormatterProps extends WithTranslation { const DistanceUnitFormatter: React.FunctionComponent = ( props: DistanceUnitFormatterProps ) => { - - const [destinationUnit, setDestinationUnit] = useState(props.destinationUnit); + const [destinationUnit, setDestinationUnit] = useState( + props.destinationUnit + ); const valueInMeters = props.sourceUnit === 'm' ? props.value : props.value / 1000; useEffect(() => { diff --git a/packages/chaire-lib-frontend/src/components/pageParts/DurationUnitFormatter.tsx b/packages/chaire-lib-frontend/src/components/pageParts/DurationUnitFormatter.tsx index e159dd0c..13b16b21 100644 --- a/packages/chaire-lib-frontend/src/components/pageParts/DurationUnitFormatter.tsx +++ b/packages/chaire-lib-frontend/src/components/pageParts/DurationUnitFormatter.tsx @@ -21,7 +21,9 @@ export interface DurationUnitFormatterProps extends WithTranslation { const DurationUnitFormatter: React.FunctionComponent = ( props: DurationUnitFormatterProps ) => { - const [destinationUnit, setDestinationUnit] = useState(props.destinationUnit); + const [destinationUnit, setDestinationUnit] = useState( + props.destinationUnit + ); const valueInSeconds = props.sourceUnit === 's' diff --git a/packages/chaire-lib-frontend/src/components/pageParts/SpeedUnitFormatter.tsx b/packages/chaire-lib-frontend/src/components/pageParts/SpeedUnitFormatter.tsx index 9f8a0ada..a511268a 100644 --- a/packages/chaire-lib-frontend/src/components/pageParts/SpeedUnitFormatter.tsx +++ b/packages/chaire-lib-frontend/src/components/pageParts/SpeedUnitFormatter.tsx @@ -18,10 +18,10 @@ export interface SpeedUnitFormatterProps extends WithTranslation { destinationUnit?: destinationUnitOptionsType; } -const SpeedUnitFormatter: React.FunctionComponent = ( - props: SpeedUnitFormatterProps -) => { - const [destinationUnit, setDestinationUnit] = useState(props.destinationUnit); +const SpeedUnitFormatter: React.FunctionComponent = (props: SpeedUnitFormatterProps) => { + const [destinationUnit, setDestinationUnit] = useState( + props.destinationUnit + ); const valueInMetersPerSecond = props.sourceUnit === 'm/s' ? props.value : mpsToKph(props.value); @@ -35,7 +35,7 @@ const SpeedUnitFormatter: React.FunctionComponent = ( const unitFormatters: Record string> = { 'm/s': (value) => `${roundToDecimals(value, 0)} ${props.t('main:mpsAbbr')}`, 'km/h': (value) => `${roundToDecimals(mpsToKph(value), 1)} ${props.t('main:kphAbbr')}`, - 'mph': (value) => `${roundToDecimals(mpsToMph(value), 1)} ${props.t('main:mphAbbr')}`, + mph: (value) => `${roundToDecimals(mpsToMph(value), 1)} ${props.t('main:mphAbbr')}`, 'ft/s': (value) => `${roundToDecimals(mpsToFtps(value), 0)} ${props.t('main:ftpsAbbr')}` }; diff --git a/packages/transition-frontend/src/components/forms/path/TransitPathNodeButton.tsx b/packages/transition-frontend/src/components/forms/path/TransitPathNodeButton.tsx index 71c1a7dc..c71ef46b 100644 --- a/packages/transition-frontend/src/components/forms/path/TransitPathNodeButton.tsx +++ b/packages/transition-frontend/src/components/forms/path/TransitPathNodeButton.tsx @@ -122,10 +122,22 @@ const TransitPathButton: React.FunctionComponent = (props: Path
  • - {segments[nodeIndex]?.travelTimeSeconds ? : '? s'} + {segments[nodeIndex]?.travelTimeSeconds ? ( + + ) : ( + '? s' + )} - {segments[nodeIndex]?.distanceMeters ? : '?'} + {segments[nodeIndex]?.distanceMeters ? ( + + ) : ( + '?' + )} {cumulativeTimeSecondsAfter && cumulativeDistanceMeters &&
    } {cumulativeTimeSecondsAfter && cumulativeDistanceMeters && ( @@ -140,14 +152,13 @@ const TransitPathButton: React.FunctionComponent = (props: Path )} {cumulativeTimeSecondsAfter && ( - + )} - ― -   + ―   {cumulativeDistanceMeters && ( - + )}
    diff --git a/packages/transition-frontend/src/components/forms/path/TransitPathStatistics.tsx b/packages/transition-frontend/src/components/forms/path/TransitPathStatistics.tsx index 8dd41921..48bf219e 100644 --- a/packages/transition-frontend/src/components/forms/path/TransitPathStatistics.tsx +++ b/packages/transition-frontend/src/components/forms/path/TransitPathStatistics.tsx @@ -26,12 +26,10 @@ interface StatsRowProps extends WithTranslation { const StatsRowBase: React.FunctionComponent = (props: StatsRowProps) => { const value = props.value !== null && props.value !== undefined ? props.value : props.defaultValue || '?'; const pathStatFormula = pathStatsFormula[props.variable]; - const { - translatableString, - latexExpression, - } = typeof pathStatFormula === 'string' - ? { translatableString: `variable:${props.variable}`, latexExpression: props.variable } - : pathStatFormula; + const { translatableString, latexExpression } = + typeof pathStatFormula === 'string' + ? { translatableString: `variable:${props.variable}`, latexExpression: props.variable } + : pathStatFormula; return ( {props.t(translatableString)} @@ -81,46 +79,172 @@ const TransitPathStatistics: React.FunctionComponent = (props: P return ( - {variables && : '?'}/>} + {variables && ( + + ) : ( + '?' + ) + } + /> + )} {variables && } - {variables && : '?'} />} - {variables && : '?'} />} - {variables && : '?'} />} - {variables && : '?'} />} + {variables && ( + + ) : ( + '?' + ) + } + /> + )} + {variables && ( + + ) : ( + '?' + ) + } + /> + )} + {variables && ( + + ) : ( + '?' + ) + } + /> + )} + {variables && ( + + ) : ( + '?' + ) + } + /> + )} {variables && ( )} {variables && ( )} - {variables && : '0'} />} + {variables && ( + + ) : ( + '0' + ) + } + /> + )} } + value={ + + } /> } + value={ + + } /> } + value={ + + } /> } + value={ + + } /> } + value={ + + } /> } + value={ + + } /> {temporalTortuosity && (