From 4e880f6efe86c0b7e86e587e08eeee0f594417d5 Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Sat, 17 Apr 2021 21:06:17 +0530 Subject: color coded ItemsDisplay --- src/components/Display/SummaryDisplay.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/components/Display/SummaryDisplay.js') diff --git a/src/components/Display/SummaryDisplay.js b/src/components/Display/SummaryDisplay.js index 8acddc9..ebc382c 100644 --- a/src/components/Display/SummaryDisplay.js +++ b/src/components/Display/SummaryDisplay.js @@ -4,6 +4,7 @@ import "./Display.css"; const getSummary = (items) => { let totalRawPrice = 0; let totalQuantity = 0; + for (let i = 0; i < items.length; i++) { totalRawPrice += items[i].Price; totalQuantity += items[i].Quantity @@ -19,17 +20,16 @@ const getSummary = (items) => { const SummaryDisplayTR = (props) => { const summary = getSummary(props.items); - console.log(summary) return ( - + Total - - + + {summary.TotalQuantity} + + {summary.TotalRawPrice} - - ); } -- cgit v1.2.3