Skip to content

Commit

Permalink
hide facilitator approve until needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanlesich committed Aug 9, 2024
1 parent a66dfaf commit 9dbfd10
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/components/grant/FacilitatorActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,28 @@ import { Button, Stack, Text } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import { IconPlus } from '@tabler/icons-react';
import { FacilitatorApprovalDrawer } from './FacilitatorApprovalDrawer';
import { useGrant } from '../../hooks/useGrant';
import { GameStatus, GrantStatus } from '../../types/common';

export const FacilitatorActions = () => {
const [approvalOpened, { open: openApprove, close: closeApprove }] =
useDisclosure();

const { grant } = useGrant();

const isReadyToApprove = grant?.status === GrantStatus.MilestonesApproved;
return (
<>
<Stack pos="fixed" top={'260px'} gap="sm">
<Button variant="menu" leftSection={<IconPlus />} onClick={openApprove}>
<Text>Review Grantee</Text>
</Button>
{isReadyToApprove && (
<Button
variant="menu"
leftSection={<IconPlus />}
onClick={openApprove}
>
<Text>Review Grantee</Text>
</Button>
)}
</Stack>
<FacilitatorApprovalDrawer
opened={approvalOpened}
Expand Down

0 comments on commit 9dbfd10

Please sign in to comment.