diff --git a/frontend/app/components/Name.jsx b/frontend/app/components/Name.jsx index 5b7fc20..33db91a 100644 --- a/frontend/app/components/Name.jsx +++ b/frontend/app/components/Name.jsx @@ -47,7 +47,6 @@ export default function Name() { const teamId = e.currentTarget.value; const matches = people.filter((p) => p.teamId === teamId); - setSelectedTeamId(teamId); setPeopleInTeam(matches); @@ -74,7 +73,7 @@ export default function Name() { {/* Header */} {!selectedTeamId ? ( -
+

Select your team. @@ -84,14 +83,16 @@ export default function Name() {

- {teams.map((t) => { - const colour = colours[Math.floor(Math.random() * colours.length)]; + {teams.map((t, index) => { + const colour = + colours[index > colours.length - 1 ? index - colours.length : index]; return (
) : ( -
+

Select your name. @@ -120,16 +121,19 @@ export default function Name() {

- {peopleInTeam.map((p) => { - const colour = colours[Math.floor(Math.random() * colours.length)]; + {peopleInTeam.map((p, index) => { + const colour = + colours[index > colours.length - 1 ? index - colours.length : index]; return (