From f38b8e1c17b662fee411d9b1999df36dd29bc186 Mon Sep 17 00:00:00 2001 From: karenjeet kaur Date: Tue, 25 Jun 2024 15:41:26 +0100 Subject: [PATCH] updated distance fields --- .../global/common/CountryLeaderboardTable.component.js | 10 +++++----- .../global/dashboard/dashboardGlobal.component.js | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/components/global/common/CountryLeaderboardTable.component.js b/app/components/global/common/CountryLeaderboardTable.component.js index f1ed8f3..ce32e9d 100644 --- a/app/components/global/common/CountryLeaderboardTable.component.js +++ b/app/components/global/common/CountryLeaderboardTable.component.js @@ -116,7 +116,7 @@ const CountryLeaderboardTable = ({ {data.map((item, idx) => { let dateCompletion = item.completionDate ? "finish" : "pending"; - const {name, members, position, totalDistanceCovered} = item; + const {name, members, position, averageDistanceConverted, totalDistanceConverted} = item; const location = name; return ( - {totalDistanceCovered ? totalDistanceCovered : 0}km + {totalDistanceConverted ? totalDistanceConverted : 0}km - {averageDistance(totalDistanceCovered, usersByLocation, location)}km + {averageDistanceConverted ? averageDistanceConverted : 0}km ); @@ -183,10 +183,10 @@ const CountryLeaderboardTable = ({
- {totalDistanceCovered} + {totalDistanceConverted ? totalDistanceConverted : 0}km
- {averageDistance(totalDistanceCovered, usersByLocation, location)} + {averageDistanceConverted ? averageDistanceConverted : 0}km km
diff --git a/app/components/global/dashboard/dashboardGlobal.component.js b/app/components/global/dashboard/dashboardGlobal.component.js index 92c886e..385352d 100644 --- a/app/components/global/dashboard/dashboardGlobal.component.js +++ b/app/components/global/dashboard/dashboardGlobal.component.js @@ -257,6 +257,7 @@ class DashboardGlobal extends React.Component { return this.forceUpdate(); case "office": this.setState({ + userData: personal, currentData: locations, filteredData: locations, activeTab: "office",