Skip to content

Commit 215707e

Browse files
committed
Update: pin 'All Teams' to top of repo dropdown
1 parent 5eb8682 commit 215707e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Frontend/src/features/team-stats/components/teamStatsSidebar.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ const TeamStatsSidebar = ({
6666
}}
6767
>
6868
{[...TEAMS]
69-
.sort((a, b) => a.localeCompare(b)) // Sort alphabetically
69+
.sort((a, b) => {
70+
// Keeping "All Teams" at the top
71+
if (a === "All Teams") return -1;
72+
if (b === "All Teams") return 1;
73+
74+
// Sort the rest alphabetically
75+
return a.localeCompare(b);
76+
})
7077
.map((t, index) => (
7178
<option key={`repo-${index}`} value={t}>
7279
{t}

0 commit comments

Comments
 (0)