mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-24 17:51:14 +02:00
Currently our bundle size is clocking in at: 1,798.28 kB │ gzip: 558.42 kB After the changes: 1,299.32 kB │ gzip: 403.26 kB
23 lines
734 B
TypeScript
23 lines
734 B
TypeScript
import { useContext } from 'react';
|
|
import AccessContext from 'contexts/AccessContext';
|
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
|
import ProjectRoleList from './ProjectRoleList/ProjectRoleList';
|
|
import { AdminAlert } from 'component/common/AdminAlert/AdminAlert';
|
|
|
|
const ProjectRoles = () => {
|
|
const { hasAccess } = useContext(AccessContext);
|
|
|
|
return (
|
|
<div>
|
|
<ConditionallyRender
|
|
condition={hasAccess(ADMIN)}
|
|
show={<ProjectRoleList />}
|
|
elseShow={<AdminAlert />}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default ProjectRoles;
|