1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-26 06:54:18 +00:00
pds-2021-g2-nest/code/frontend/src/routes/PageUsers.js

30 lines
930 B
JavaScript
Raw Normal View History

2021-05-11 21:27:42 +00:00
import React, { useContext } from "react"
2021-05-11 17:42:04 +00:00
import Style from "./PageDashboard.module.css"
import classNames from "classnames"
import BoxHeader from "../components/base/BoxHeader"
2021-05-11 21:27:42 +00:00
import BoxUserCreate from "../components/interactive/BoxUserCreate"
import ContextUser from "../contexts/ContextUser"
import BoxAlert from "../components/base/BoxAlert"
2021-05-11 17:42:04 +00:00
2021-05-11 21:27:42 +00:00
export default function PageUsers({ children, className, ...props }) {
const { user } = useContext(ContextUser)
if(!user.isAdmin) {
return (
<BoxAlert color={"Red"}>
Non sei un amministratore, pertanto non puoi gestire gli utenti della piattaforma.
</BoxAlert>
)
}
2021-05-11 17:42:04 +00:00
return (
<div className={classNames(Style.PageHome, className)} {...props}>
<BoxHeader className={Style.Header}>
2021-05-11 21:27:42 +00:00
Gestisci utenti
2021-05-11 17:42:04 +00:00
</BoxHeader>
2021-05-11 21:27:42 +00:00
<BoxUserCreate/>
2021-05-11 17:42:04 +00:00
</div>
)
}