-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client: display user statistics - #9
- Loading branch information
Showing
5 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from 'react' | ||
|
||
|
||
export default function UserStatistics (props) { | ||
const { user } = props | ||
return ( | ||
<div className="row"> | ||
<div className="col"> | ||
<div className="card activity-card"> | ||
<div className="card-body row"> | ||
<div className="col-3"> | ||
<i className="fa fa-calendar fa-3x fa-color" /> | ||
</div> | ||
<div className="col-9 text-right"> | ||
<div className="huge">{user.nbActivities}</div> | ||
<div>{user.nbActivities === 1 ? 'activity' : 'activities'}</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="col"> | ||
<div className="card activity-card"> | ||
<div className="card-body row"> | ||
<div className="col-3"> | ||
<i className="fa fa-road fa-3x fa-color" /> | ||
</div> | ||
<div className="col-9 text-right"> | ||
<div className="huge"> | ||
{Math.round(user.totalDistance * 100) / 100} | ||
</div> | ||
<div>km</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="col"> | ||
<div className="card activity-card"> | ||
<div className="card-body row"> | ||
<div className="col-3"> | ||
<i className="fa fa-clock-o fa-3x fa-color" /> | ||
</div> | ||
<div className="col-9 text-right"> | ||
<div className="huge">{user.totalDuration}</div> | ||
<div>total duration</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="col"> | ||
<div className="card activity-card"> | ||
<div className="card-body row"> | ||
<div className="col-3"> | ||
<i className="fa fa-tags fa-3x fa-color" /> | ||
</div> | ||
<div className="col-9 text-right"> | ||
<div className="huge">{user.nbSports}</div> | ||
<div>{`sport${user.nbSports === 1 ? '' : 's'}`}</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters