diff --git a/src/components/TeamAssignment/TeamsWithCandidates.tsx b/src/components/TeamAssignment/TeamsWithCandidates.tsx index 643c283..483386a 100644 --- a/src/components/TeamAssignment/TeamsWithCandidates.tsx +++ b/src/components/TeamAssignment/TeamsWithCandidates.tsx @@ -4,6 +4,7 @@ import { selectTeamList } from "../../store/teamList" import TeamWithCandidates from "./TeamWithCandidates" import styles from "./styles.module.scss" import withUserRole from "../../utils/withUserRole" +import ROLES from "../../utils/roles.constants" const TeamsWithCandidates: FC = (): JSX.Element => { const teams = useSelector(selectTeamList) @@ -26,4 +27,4 @@ const TeamsWithCandidates: FC = (): JSX.Element => { ) } -export default withUserRole("répartiteur", memo(TeamsWithCandidates)) +export default withUserRole(ROLES.ASSIGNER, memo(TeamsWithCandidates)) diff --git a/src/components/TeamMembers/TeamMembers.tsx b/src/components/TeamMembers/TeamMembers.tsx index 40afeca..da7df73 100644 --- a/src/components/TeamMembers/TeamMembers.tsx +++ b/src/components/TeamMembers/TeamMembers.tsx @@ -8,6 +8,7 @@ import styles from "./styles.module.scss" import { Volunteer } from "../../services/volunteers" import { Team } from "../../services/teams" import withUserRole from "../../utils/withUserRole" +import ROLES from "../../utils/roles.constants" interface ExtendedVolunteer extends Volunteer { teamObject: Team | undefined @@ -31,7 +32,7 @@ type VolunteerEmailProps = { email: string } -const VolunteerEmail: FC = withUserRole("référent", ({ email }) => ( +const VolunteerEmail: FC = withUserRole(ROLES.TEAMLEAD, ({ email }) => (
{email}
)) diff --git a/src/utils/roles.constants.ts b/src/utils/roles.constants.ts new file mode 100644 index 0000000..6147da8 --- /dev/null +++ b/src/utils/roles.constants.ts @@ -0,0 +1,10 @@ +type rolesType = { + [key: string]: string +} + +const ROLES: rolesType = { + ASSIGNER: "répartiteur", + TEAMLEAD: "référent", +} + +export default ROLES