From 9cc000f6e23d75e826c4468dd5c3977397e58e57 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Mon, 2 Nov 2015 16:04:14 -0800 Subject: Functionalized code --- web/react/components/navbar_dropdown.jsx | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'web/react/components') diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx index 937e88325..029b9c137 100644 --- a/web/react/components/navbar_dropdown.jsx +++ b/web/react/components/navbar_dropdown.jsx @@ -18,24 +18,8 @@ function getStateFromStores() { teams.push(teamsObject[teamId]); } } - teams.sort((teamA, teamB) => { - let teamADisplayName = ''; - let teamBDisplayName = ''; - if (teamA && teamA.display_name) { - teamADisplayName = teamA.display_name.toLowerCase(); - } - if (teamB && teamB.display_name) { - teamBDisplayName = teamB.display_name.toLowerCase(); - } - - if (teamADisplayName < teamBDisplayName) { - return -1; - } else if (teamADisplayName > teamBDisplayName) { - return 1; - } - return 0; - }); + teams.sort(Utils.sortByDisplayName); return {teams}; } -- cgit v1.2.3-1-g7c22