Skip to content

Commit

Permalink
sort table by coin earning desc
Browse files Browse the repository at this point in the history
  • Loading branch information
xalunda committed May 3, 2018
1 parent 892d35c commit 8f244b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/HomePage/CoinTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ const styles = theme => ({
function CoinTable(props) {
const { classes, crypto } = props;

crypto.coins.sort((l, r) => {
return (
l.total_price === r.total_price
? 0
: (l.total_price < r.total_price ? 1 : -1)
)
})

return (
<Paper className={classes.root}>
<Table className={classes.table}>
Expand Down

0 comments on commit 8f244b3

Please sign in to comment.