diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 3b4fd593..7f311df0 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -6,6 +6,7 @@ import { isApplicationPeriodActive, getAdmissionPeriod, } from '../services/Applications' +import isOrganizer from '../utils/isOrganizer' const useStyles = createStyles((theme) => ({ dashboardWrapper: { @@ -74,10 +75,14 @@ function Dashboard() { const [periodOpen, setPeriodOpen] = useState(false) const [startDate, setStartDate] = useState('') const [endDate, setEndDate] = useState('') + const [isTheOrganizer, setTheOrganizer] = useState(false) useEffect(() => { const getApplicationPeriodActiveAsync = async () => { try { + if (await isOrganizer()) { + setTheOrganizer(true) + } const response = await isApplicationPeriodActive() setPeriodOpen(response) if (response) { @@ -136,12 +141,14 @@ function Dashboard() { > Opptaksstatus - navigate('/admission-period')} - > - Opptaksperiode - + {isTheOrganizer && ( + navigate('/admission-period')} + > + Opptaksperiode + + )} )