Skip to content

Commit

Permalink
Hide ApplicantSummary for non-managers
Browse files Browse the repository at this point in the history
- Show `ApplicantSummary` on Admin Dashboard only for application
  managers (director/reviewer)
  • Loading branch information
taesungh committed Jan 21, 2024
1 parent 8aa8dbc commit d74ea59
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/site/src/app/admin/dashboard/AdminDashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
"use client";

import { useContext } from "react";

import Container from "@cloudscape-design/components/container";
import ContentLayout from "@cloudscape-design/components/content-layout";
import SpaceBetween from "@cloudscape-design/components/space-between";

import { isApplicationManager } from "@/lib/admin/authorization";
import UserContext from "@/lib/admin/UserContext";

import ApplicantSummary from "./components/ApplicantSummary";

function AdminDashboard() {
const { role } = useContext(UserContext);

return (
<ContentLayout>
<SpaceBetween size="l">
<Container>Admin Dashboard</Container>
<ApplicantSummary />
{isApplicationManager(role) && <ApplicantSummary />}
</SpaceBetween>
</ContentLayout>
);
Expand Down

0 comments on commit d74ea59

Please sign in to comment.