Skip to content

Commit

Permalink
Merge pull request #205 from DAOmasons/resubmitWarning
Browse files Browse the repository at this point in the history
prevent user footguns by warning them before they resubmit
  • Loading branch information
jordanlesich authored May 10, 2024
2 parents 3d479a7 + 6a7b2f4 commit 0f3661e
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/pages/ApplyFunding.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useMediaQuery } from '@mantine/hooks';
import {
Box,
Button,
Flex,
Group,
Expand All @@ -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';
Expand Down Expand Up @@ -105,6 +111,7 @@ export const ApplyFunding = () => {
const { switchChainAsync } = useSwitchChain();
const { connect } = useConnect();
const { tx } = useTx();
const theme = useMantineTheme();

const form = useForm({
initialValues: defaultValues,
Expand Down Expand Up @@ -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) && (
<Flex mb="md" mt="md" align="start" gap={'xs'}>
<Box>
<IconInfoCircle color={theme.colors.yellow[6]} size={24} />
</Box>
<Text fs="italic">
WARNING. This grant has already been approved. If you edit this
application, the Ship Operator will need to approve it again.
</Text>
</Flex>
)}
<Flex mt="md" justify="flex-end">
<Button
ml="auto"
Expand Down

0 comments on commit 0f3661e

Please sign in to comment.