Skip to content

Commit

Permalink
can submit after approve
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanlesich committed Aug 16, 2024
1 parent 6227b38 commit 9116479
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 25 deletions.
4 changes: 1 addition & 3 deletions src/components/dashboard/facilitator/FacPostUpdatePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import { DAO_MASONS } from '../../../constants/gameSetup';
import { UpdateInput } from '../../forms/UpdateInput';
import { PINATA_GATEWAY, getGatewayUrl } from '../../../utils/ipfs/get';
import { getGatewayUrl } from '../../../utils/ipfs/get';
import { useTx } from '../../../hooks/useTx';
import GameManagerAbi from '../../../abi/GameManager.json';
import { ADDR } from '../../../constants/addresses';
Expand Down
5 changes: 3 additions & 2 deletions src/components/grant/ApplicationDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ export const ApplicationDrawer = ({
{alreadyHasApplication &&
currentApplication.status !== GameStatus.Rejected && (
<Text mb="md" size="sm" c={theme.colors.yellow[6]}>
You have already submitted an application. Resubmitting an old
application will overwrite the previous one.
WARNING: You have already submitted an application. Resubmitting an
old application will overwrite the previous one and restart the
grant process from the beginning.
</Text>
)}
<Stack mb="md">
Expand Down
27 changes: 16 additions & 11 deletions src/components/grant/ProjectActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export const ProjectActions = () => {
useDisclosure();

const isApplicationStage =
!grant || (grant?.status && grant.status < GrantStatus.ApplicationApproved);
!grant || (grant?.status && grant.status < GrantStatus.MilestonesApproved);

const isMilestonePlanning =
grant?.status &&
grant.status >= GrantStatus.ApplicationApproved &&
Expand All @@ -45,6 +46,20 @@ export const ProjectActions = () => {
return (
<>
<Stack pos="fixed" top={'260px'} gap="sm">
{isApplicationStage && alreadyHasApplication && (
<Button
variant={
grant?.status && grant.status > GrantStatus.ApplicationApproved
? 'menu-fade'
: 'menu'
}
leftSection={<IconPencil />}
onClick={openApplication}
>
<Text>Application</Text>
</Button>
)}

{isMilestonePlanning && (
<Button
variant="menu"
Expand All @@ -70,16 +85,6 @@ export const ProjectActions = () => {
<Text>Milestones</Text>
</Button>
)}
{isApplicationStage && alreadyHasApplication && (
<Button
variant="menu"
leftSection={<IconPencil />}
onClick={openApplication}
>
<Text>Resubmit Application</Text>
</Button>
)}

{isApplicationStage && !alreadyHasApplication && (
<Button
variant="menu"
Expand Down
11 changes: 2 additions & 9 deletions src/pages/ShipOpDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,24 @@ import { DashShip, getShipDash } from '../queries/getShipDash';
import { AppAlert } from '../components/UnderContruction';
import { useTx } from '../hooks/useTx';
import { notifications } from '@mantine/notifications';
import { UpdateInput } from '../components/forms/UpdateInput';
import { pinJSONToIPFS } from '../utils/ipfs/pin';
import {
ContentSchema,
basicUpdateSchema,
} from '../components/forms/validationSchemas/updateSchemas';
import ShipAbi from '../abi/GrantShip.json';
import { Tag } from '../constants/tags';
import { Address } from 'viem';
import { DAO_MASONS, GAME_MANAGER, ZER0_ADDRESS } from '../constants/gameSetup';
import { GAME_MANAGER, ZER0_ADDRESS } from '../constants/gameSetup';

import { SettingsPanel } from '../components/dashboard/ship/SettingsPanel';
import { getShipGrants } from '../queries/getShipGrants';
import { GrantCard } from '../components/grant/GrantCard';
import { GrantStatus } from '../types/common';
import { useMemo } from 'react';
import { Player } from '../types/ui';
import { getGatewayUrl } from '../utils/ipfs/get';

import { PlayerAvatar } from '../components/PlayerAvatar';
import { TxButton } from '../components/TxButton';
import { IconPlus } from '@tabler/icons-react';
import { tiptapContentSchema } from '../components/forms/validationSchemas/tiptap';
import { useEditor } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';
import { useGameManager } from '../hooks/useGameMangers';
import { RTEditor } from '../components/RTEditor';

export const ShipOpDashboard = () => {
Expand Down
21 changes: 21 additions & 0 deletions src/styles/extendButtonTheme.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,25 @@
color: var(--mantine-color-gray-9);
}
}
&[data-variant='menu-fade'] {
background-color: transparent;
color: var(--mantine-color-dark-3);

border-radius: var(--mantine-radius-xl);
width: fit-content;
height: 40px;
transition:
background-color 100ms,
color 100ms;
border: 1px solid var(--mantine-color-dark-6);
&:hover {
background-color: var(--mantine-color-dark-6);

color: var(--mantine-color-gray-2);
}
&:disabled {
background-color: var(--mantine-color-gray-6);
color: var(--mantine-color-gray-9);
}
}
}

0 comments on commit 9116479

Please sign in to comment.