Skip to content

Commit

Permalink
feat: hide add project button when signed in as drone operator (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Prajwalism authored Jul 22, 2024
1 parent 156527d commit 257d260
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/frontend/src/components/Projects/ProjectsHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import { Button } from '@Components/RadixComponents/Button';
export default function ProjectsHeader() {
const dispatch = useTypedDispatch();
const navigate = useNavigate();

const signedInAs = localStorage.getItem('signedInAs') || 'Project Creator';

const showMap = useTypedSelector(state => state.common.showMap);

return (
<FlexRow className="naxatw-items-center naxatw-justify-between naxatw-py-3">
<h5 className="naxatw-font-bold">Projects</h5>
Expand All @@ -22,13 +26,15 @@ export default function ProjectsHeader() {
}}
/>
</FlexRow>
<Button
variant="secondary"
className="!naxatw-bg-red naxatw-text-white"
onClick={() => navigate('/create-project')}
>
Add Project
</Button>
{signedInAs === 'Project Creator' && (
<Button
variant="secondary"
className="!naxatw-bg-red naxatw-text-white"
onClick={() => navigate('/create-project')}
>
Add Project
</Button>
)}
</FlexRow>
</FlexRow>
);
Expand Down

0 comments on commit 257d260

Please sign in to comment.