Skip to content

Commit

Permalink
only show tab for superusers
Browse files Browse the repository at this point in the history
  • Loading branch information
rm03 committed Oct 12, 2024
1 parent f659927 commit a1ed301
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions frontend/components/ClubEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
School,
StudentType,
Tag,
UserInfo,
VisitType,
Year,
} from '../types'
Expand Down Expand Up @@ -75,6 +76,7 @@ type ClubFormProps = {
tags: Tag[]
studentTypes: StudentType[]
tab?: string | null
userInfo?: UserInfo
}

const ClubForm = ({
Expand All @@ -86,6 +88,7 @@ const ClubForm = ({
studentTypes,
clubId,
tab,
userInfo,
}: ClubFormProps): ReactElement => {
const [club, setClub] = useState<Club | null>(null)
const [isEdit, setIsEdit] = useState<boolean>(typeof clubId !== 'undefined')
Expand Down Expand Up @@ -238,11 +241,15 @@ const ClubForm = ({
/>
),
},
{
name: 'notes',
label: 'Administrator Notes',
content: <AdminNoteCard club={club} />,
},
...(userInfo !== undefined && userInfo.is_superuser
? [
{
name: 'notes',
label: 'Administrator Notes',
content: <AdminNoteCard club={club} />,
},
]
: []),
{
name: 'member',
label: OBJECT_TAB_MEMBERSHIP_LABEL,
Expand Down

0 comments on commit a1ed301

Please sign in to comment.