Skip to content

Commit

Permalink
Add Permissions component to handle isPlatformAdmin logic
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Jul 22, 2024
1 parent b639547 commit 8a0e585
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions editor.planx.uk/src/pages/Teams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import navigation from "lib/navigation";
import React from "react";
import { Link } from "react-navi";
import { borderedFocusStyle } from "theme";
import Permission from "ui/editor/Permission";
import { slugify } from "utils";

import { useStore } from "./FlowEditor/lib/store";
Expand Down Expand Up @@ -93,7 +94,7 @@ const Teams: React.FC<Props> = ({ teams, teamTheme }) => {
<Typography variant="h2" component="h1">
Select a team
</Typography>
{isPlatformAdmin ? (
<Permission.IsPlatformAdmin>
<AddButton
onClick={async () => {
const newTeamName = prompt("Team name");
Expand All @@ -118,7 +119,7 @@ const Teams: React.FC<Props> = ({ teams, teamTheme }) => {
>
Add a new team
</AddButton>
) : null}
</Permission.IsPlatformAdmin>
</Box>
{editableTeams.length > 0 && (
<>
Expand Down

0 comments on commit 8a0e585

Please sign in to comment.