From 6a7b2f4093bcf26fb2366849eac7f3fdcb1e3648 Mon Sep 17 00:00:00 2001 From: jordan Date: Thu, 9 May 2024 18:43:54 -0700 Subject: [PATCH] prevent user footguns by warning them before they resubmit --- src/pages/ApplyFunding.tsx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/pages/ApplyFunding.tsx b/src/pages/ApplyFunding.tsx index 4e2f3408..0af06cef 100644 --- a/src/pages/ApplyFunding.tsx +++ b/src/pages/ApplyFunding.tsx @@ -1,5 +1,6 @@ import { useMediaQuery } from '@mantine/hooks'; import { + Box, Button, Flex, Group, @@ -9,9 +10,14 @@ import { TextInput, Textarea, em, + useMantineTheme, } from '@mantine/core'; import { useForm, zodResolver } from '@mantine/form'; -import { IconCalendar, IconExternalLink } from '@tabler/icons-react'; +import { + IconCalendar, + IconExternalLink, + IconInfoCircle, +} from '@tabler/icons-react'; import { DatePickerInput } from '@mantine/dates'; import { z } from 'zod'; import { useAccount, useConnect, useSwitchChain } from 'wagmi'; @@ -105,6 +111,7 @@ export const ApplyFunding = () => { const { switchChainAsync } = useSwitchChain(); const { connect } = useConnect(); const { tx } = useTx(); + const theme = useMantineTheme(); const form = useForm({ initialValues: defaultValues, @@ -528,6 +535,20 @@ export const ApplyFunding = () => { {...form.getInputProps('extraInfo')} onBlur={() => handleBlur('extraInfo')} /> + {grantData?.grantStatus != null && + (grantData?.grantStatus === GrantStatus.ShipApproved || + grantData?.grantStatus === GrantStatus.ShipRejected || + grantData?.grantStatus === GrantStatus.FacilitatorRejected) && ( + + + + + + WARNING. This grant has already been approved. If you edit this + application, the Ship Operator will need to approve it again. + + + )}