From a1ed3016af9d97dd5b0d7743e11cd8ad28ce474a Mon Sep 17 00:00:00 2001 From: Rohan Moniz <60864468+rm03@users.noreply.github.com> Date: Sat, 12 Oct 2024 19:43:17 -0400 Subject: [PATCH] only show tab for superusers --- frontend/components/ClubEditPage.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/components/ClubEditPage.tsx b/frontend/components/ClubEditPage.tsx index 316eedb1e..72445905e 100644 --- a/frontend/components/ClubEditPage.tsx +++ b/frontend/components/ClubEditPage.tsx @@ -26,6 +26,7 @@ import { School, StudentType, Tag, + UserInfo, VisitType, Year, } from '../types' @@ -75,6 +76,7 @@ type ClubFormProps = { tags: Tag[] studentTypes: StudentType[] tab?: string | null + userInfo?: UserInfo } const ClubForm = ({ @@ -86,6 +88,7 @@ const ClubForm = ({ studentTypes, clubId, tab, + userInfo, }: ClubFormProps): ReactElement => { const [club, setClub] = useState(null) const [isEdit, setIsEdit] = useState(typeof clubId !== 'undefined') @@ -238,11 +241,15 @@ const ClubForm = ({ /> ), }, - { - name: 'notes', - label: 'Administrator Notes', - content: , - }, + ...(userInfo !== undefined && userInfo.is_superuser + ? [ + { + name: 'notes', + label: 'Administrator Notes', + content: , + }, + ] + : []), { name: 'member', label: OBJECT_TAB_MEMBERSHIP_LABEL,