From d134f7ac4b881d425810e3d38c8e6a9df911a053 Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Mon, 17 Jun 2019 13:09:30 +0200 Subject: [PATCH] align fee column to the right --- client/src/scenes/IncidentsReport/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/scenes/IncidentsReport/index.js b/client/src/scenes/IncidentsReport/index.js index defc361..09a76cb 100644 --- a/client/src/scenes/IncidentsReport/index.js +++ b/client/src/scenes/IncidentsReport/index.js @@ -27,6 +27,12 @@ class IncidentsReport extends Component { const columnTitle = incidentsReportHeaderTitles[header]; if (columnTitle){ + const columnAlignments = { + left: 'left', + right: 'right', + }; + let columnContentsAlignment = columnAlignments.left; + columns.push({ Header: incidentsReportHeaderTitles[header], accessor: header, @@ -55,14 +61,16 @@ class IncidentsReport extends Component { case 'totalChargeFee': const totalFee = props.value ? props.value : props.row['_original'].incidentPrice; - cellValue = `$ ${totalFee}`; + const totalFeeFormatted = parseFloat(totalFee).toFixed(2); + cellValue = `$ ${totalFeeFormatted}`; + columnContentsAlignment = columnAlignments.right; break; default: cellValue = props.value; } - return {cellValue} + return
{cellValue}
} }); }