Skip to content

Commit

Permalink
front: reduce font size of min/100km in timesstops output table
Browse files Browse the repository at this point in the history
Signed-off-by: Alice Khoudli <[email protected]>
  • Loading branch information
Synar committed Nov 25, 2024
1 parent 876dccc commit 7046a03
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
13 changes: 13 additions & 0 deletions front/src/modules/timesStops/hooks/useTimeStopsColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { disabledTextColumn } from '../helpers/utils';
import ReadOnlyTime from '../ReadOnlyTime';
import TimeInput from '../TimeInput';
import { TableType, type TimeExtraDays, type TimeStopsRow } from '../types';
import { NO_BREAK_SPACE } from 'utils/strings';

const timeColumn = (isOutputTable: boolean) =>
({
Expand Down Expand Up @@ -167,6 +168,18 @@ export const useTimeStopsColumns = <T extends TimeStopsRow>(
alignRight: true,
})
),
...(isOutputTable && {
component: ({ rowData }) => {
const [digits, unit] = rowData.theoreticalMargin?.split(NO_BREAK_SPACE) ?? [];
return (
<span className="dsg-input dsg-input-align-right self-center">
{digits}
{NO_BREAK_SPACE}
<span className={cx({ smallUnit: unit === 'min/100km' })}>{unit}</span>
</span>
);
},
}),
cellClassName: ({ rowData }) =>
cx({
invalidCell: !isOutputTable && !rowData.isMarginValid,
Expand Down
8 changes: 6 additions & 2 deletions front/src/modules/timesStops/styles/_timesStopsDatasheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
--dsg-header-text-color: var(--grey50);
--dsg-header-active-text-color: var(--black100);

.invalidCell {
color: red !important;
}

.padded-header > * {
padding-inline: 8px 16px;
}
Expand All @@ -19,8 +23,8 @@
color: var(--grey50);
}

.invalidCell {
color: red !important;
.smallUnit {
font-size: 0.65rem;
}

.repeatedValue {
Expand Down

0 comments on commit 7046a03

Please sign in to comment.