Skip to content

Commit 3be882e

Browse files
author
Kevin Crain
committed
Sort profile tracks
1 parent aa36808 commit 3be882e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/shared/containers/Profile.jsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ class ProfileContainer extends React.Component {
4848
return <Error404 />;
4949
}
5050

51+
if (info && info.tracks && info.tracks.length > 0) {
52+
const trackRankings = {
53+
COPILOT: 0,
54+
DATA_SCIENCE: 1,
55+
DESIGN: 2,
56+
DEVELOP: 3,
57+
};
58+
info.tracks.sort((track1, track2) => {
59+
const track1Ranking = trackRankings[track1];
60+
const track2Ranking = trackRankings[track2];
61+
return track2Ranking - track1Ranking;
62+
});
63+
}
64+
5165
return achievements && info && skills && stats
5266
? (
5367
<ProfilePage

0 commit comments

Comments
 (0)