OrgProfiles.tsx 1.3 KB
Newer Older
1
import { createStyles, makeStyles, Typography, Theme } from '@material-ui/core';
2
import BusinessIcon from '@material-ui/icons/Business';
3
import { brightOrange, iconGray, PERMISSIONS_BASED_ON_ROLES } from '../../../Constants/Constants';
Zhou Fang's avatar
Zhou Fang committed
4
5
import GlobalContext from '../../../Context/GlobalContext';
import { checkPermission } from '../../../Utils/portalFunctionHelpers';
6
7
import OrgProfilesBasicInfo from './OrgProfilesBasicInfo';
import OrgProfilesLinks from './OrgProfilesLinks';
8
import { useContext } from 'react';
Zhou Fang's avatar
Zhou Fang committed
9
import NoAccess from '../../ErrorPages/NoAccess';
10
11
12
13
14
15
16
17
18
19
20
21
22
23

const useStyle = makeStyles((theme: Theme) =>
  createStyles({
    headerIcon: {
      fontSize: 80,
      color: iconGray,
      borderBottom: `6px ${brightOrange} solid`,
    },
    pageHeader: {
      margin: theme.spacing(0.5, 0, 4),
    },
  })
);

24
export default function OrgProfile() {
25
  const classes = useStyle();
Zhou Fang's avatar
Zhou Fang committed
26
  const { currentUser } = useContext(GlobalContext);
27

28
  return !checkPermission(PERMISSIONS_BASED_ON_ROLES.accessContacts, currentUser?.relation) ? (
Zhou Fang's avatar
Zhou Fang committed
29
30
    <NoAccess />
  ) : (
31
    <>
32
33
34
35
36
      <BusinessIcon className={classes.headerIcon} />
      <Typography variant="h4" component="h1" className={classes.pageHeader}>
        Your Organization Profile
      </Typography>

37
38
      <OrgProfilesBasicInfo />
      <OrgProfilesLinks />
39
40
41
    </>
  );
}