mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-10 01:24:20 +02:00
create constants for user roles
This commit is contained in:
parent
514cf1b833
commit
42586c7fde
@ -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))
|
||||
|
@ -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<VolunteerEmailProps> = withUserRole("référent", ({ email }) => (
|
||||
const VolunteerEmail: FC<VolunteerEmailProps> = withUserRole(ROLES.TEAMLEAD, ({ email }) => (
|
||||
<div className={styles.volunteerEmail}>{email}</div>
|
||||
))
|
||||
|
||||
|
10
src/utils/roles.constants.ts
Normal file
10
src/utils/roles.constants.ts
Normal file
@ -0,0 +1,10 @@
|
||||
type rolesType = {
|
||||
[key: string]: string
|
||||
}
|
||||
|
||||
const ROLES: rolesType = {
|
||||
ASSIGNER: "répartiteur",
|
||||
TEAMLEAD: "référent",
|
||||
}
|
||||
|
||||
export default ROLES
|
Loading…
x
Reference in New Issue
Block a user