Skip to content

Commit

Permalink
Merge pull request #257 from capcodigital/feature/CGC-115-update-offi…
Browse files Browse the repository at this point in the history
…ce-tab

updated distance fields
  • Loading branch information
andrewkentish authored Jun 25, 2024
2 parents f270adb + f38b8e1 commit 759a47b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const CountryLeaderboardTable = ({
<Table.Body className="main-table">
{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 (
<Table.Row
Expand All @@ -140,10 +140,10 @@ const CountryLeaderboardTable = ({
/>
</Table.Cell>
<Table.Cell>
{totalDistanceCovered ? totalDistanceCovered : 0}km
{totalDistanceConverted ? totalDistanceConverted : 0}km
</Table.Cell>
<Table.Cell>
{averageDistance(totalDistanceCovered, usersByLocation, location)}km
{averageDistanceConverted ? averageDistanceConverted : 0}km
</Table.Cell>
</Table.Row>
);
Expand Down Expand Up @@ -183,10 +183,10 @@ const CountryLeaderboardTable = ({
</span>
<span>
<div className={"date"}>
{totalDistanceCovered}
{totalDistanceConverted ? totalDistanceConverted : 0}km
</div>
<div className="distance">
{averageDistance(totalDistanceCovered, usersByLocation, location)}
{averageDistanceConverted ? averageDistanceConverted : 0}km
km
</div>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ class DashboardGlobal extends React.Component {
return this.forceUpdate();
case "office":
this.setState({
userData: personal,
currentData: locations,
filteredData: locations,
activeTab: "office",
Expand Down

0 comments on commit 759a47b

Please sign in to comment.