Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Use enum for role
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiebe-Vercoutter committed Apr 28, 2022
1 parent b737c03 commit 7fef2f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { useNavigate, useParams } from "react-router-dom";

import { Project } from "../../../data/interfaces";
import { useAuth } from "../../../contexts";
import { Role } from "../../../data/enums";

/**
*
Expand Down Expand Up @@ -68,7 +69,7 @@ export default function ProjectCard({
<OpenIcon />
</Title>

{!role && (
{role === Role.ADMIN && (
<Delete onClick={handleShow}>
<HiOutlineTrash size={"20px"} />
</Delete>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Project } from "../../../data/interfaces";
import { useNavigate, useParams } from "react-router-dom";
import InfiniteScroll from "react-infinite-scroller";
import { useAuth } from "../../../contexts";
import { Role } from "../../../data/enums";
/**
* @returns The projects overview page where you can see all the projects.
* You can filter on your own projects or filter on project name.
Expand Down Expand Up @@ -82,7 +83,7 @@ export default function ProjectPage() {
}}
/>
<SearchButton onClick={refreshProjects}>Search</SearchButton>
{!role && (
{role === Role.ADMIN && (
<CreateButton
onClick={() => navigate("/editions/" + editionId + "/projects/new")}
>
Expand Down

0 comments on commit 7fef2f0

Please sign in to comment.