From 2863396ecd496ae1e1451ad3426fe7fd29dc9797 Mon Sep 17 00:00:00 2001 From: jordan Date: Tue, 6 Aug 2024 22:35:56 -0700 Subject: [PATCH 1/8] fix milestone drawer --- src/components/grant/MilestonesDrawer.tsx | 20 ++++++++++++++++--- .../grant/SubmitMilestoneDrawer.tsx | 6 ++++-- src/queries/getGrant.ts | 8 +++++--- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/components/grant/MilestonesDrawer.tsx b/src/components/grant/MilestonesDrawer.tsx index f999a981..6133d34e 100644 --- a/src/components/grant/MilestonesDrawer.tsx +++ b/src/components/grant/MilestonesDrawer.tsx @@ -4,6 +4,7 @@ import { Box, Button, Group, + NumberInput, Stack, Text, TextInput, @@ -85,6 +86,10 @@ export const MilestonesDrawer = ({ setFormData({ ...formData, [e.target.name]: e.target.value }); }; + const handleSetPerc = (value: number | string, id: string) => { + setFormData((prevData) => ({ ...prevData, [id]: value })); + }; + const handleDateChange = (dateObj: Date | null, key: string) => { if (!dateObj) return; @@ -109,6 +114,8 @@ export const MilestonesDrawer = ({ }); }; + console.log('formData', formData); + const handlePostMilestones = async () => { setIsLoading(true); @@ -286,18 +293,25 @@ export const MilestonesDrawer = ({ )} - + handleSetPerc(value, `milestone-perc-${index + 1}`) + } mb="xs" /> + { + currentMilestoneSet?.resolvedMilestones.map((milestone) => { return { value: milestone.id, label: ( @@ -177,7 +177,9 @@ export const SubmitMilestoneDrawer = ({ ) : ( )} - Milestone {index + 1} + + Milestone {milestone.index + 1} + ), }; diff --git a/src/queries/getGrant.ts b/src/queries/getGrant.ts index 3d236287..38861943 100644 --- a/src/queries/getGrant.ts +++ b/src/queries/getGrant.ts @@ -200,9 +200,11 @@ export const getGrant = async (grantId: string) => { ); return { ...set, - resolvedMilestones: resolvedMilestones.filter( - Boolean - ) as ResolvedMilestone[], + resolvedMilestones: resolvedMilestones + .filter(Boolean) + .sort((a, b) => + a!.index > b!.index ? 1 : -1 + ) as ResolvedMilestone[], tag: 'milestoneSet', } as MilestonesDisplay; } else { From c32b0a5a14fafb49b851d3ad5440366d42bfe363 Mon Sep 17 00:00:00 2001 From: jordan Date: Tue, 6 Aug 2024 22:52:47 -0700 Subject: [PATCH 2/8] fix missing spaces in helper text --- src/components/grant/GrantHelpers.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/grant/GrantHelpers.tsx b/src/components/grant/GrantHelpers.tsx index 77f0e7d5..0a3f40e3 100644 --- a/src/components/grant/GrantHelpers.tsx +++ b/src/components/grant/GrantHelpers.tsx @@ -24,8 +24,8 @@ export const ProjectGrantHelpers = () => { icon={} text={ - Next Step: send a message to the Ship - Operator or submit an application + Next Step: send a Message to the Ship{' '} + Operator or submit an Application } /> @@ -38,7 +38,7 @@ export const ProjectGrantHelpers = () => { icon={} text={ - Next Step: wait for a response from the Operator or + Next Step: wait for a response from the Operator or{' '} submit an application } @@ -154,7 +154,7 @@ export const ProjectGrantHelpers = () => { icon={} text={ - Next Step: Incorporate the feedback and resubmit + Next Step: Incorporate the feedback and resubmit{' '} your Milestone{' '} } From 1fa5a54b26253799cad9cca24342b92e976b4bcb Mon Sep 17 00:00:00 2001 From: jordan Date: Tue, 6 Aug 2024 22:53:22 -0700 Subject: [PATCH 3/8] fix missing space in invitation message --- src/components/forms/ProjectMetadataForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/forms/ProjectMetadataForm.tsx b/src/components/forms/ProjectMetadataForm.tsx index 80188516..7cae6f39 100644 --- a/src/components/forms/ProjectMetadataForm.tsx +++ b/src/components/forms/ProjectMetadataForm.tsx @@ -275,7 +275,7 @@ export const ProjectMetadataForm = ({ onClick={() => onSubmit(form.values)} disabled={!form.isValid()} > - {isEditing ? 'Edit Project' : 'Register Project'} + {isEditing ? 'Save' : 'Register Project'} From 323ecec44f08b77829ea5a4698364e31991027fb Mon Sep 17 00:00:00 2001 From: jordan Date: Tue, 6 Aug 2024 22:53:47 -0700 Subject: [PATCH 4/8] switch edit project to Save --- src/components/grant/InsetUpdate.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/grant/InsetUpdate.tsx b/src/components/grant/InsetUpdate.tsx index 99b74e6d..cc3dd322 100644 --- a/src/components/grant/InsetUpdate.tsx +++ b/src/components/grant/InsetUpdate.tsx @@ -26,8 +26,7 @@ export const InsetUpdate = ({ {symbolUI} - {posterName} - {tagline} + {posterName} {tagline} ยท From 5bd6ecb7c849eeb359002ca26683a193e7d82a81 Mon Sep 17 00:00:00 2001 From: jordan Date: Tue, 6 Aug 2024 23:07:30 -0700 Subject: [PATCH 5/8] member icon has tooltip and copy in project page --- src/components/AddressAvatar.tsx | 39 ++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/components/AddressAvatar.tsx b/src/components/AddressAvatar.tsx index 5463e56d..19af94e1 100644 --- a/src/components/AddressAvatar.tsx +++ b/src/components/AddressAvatar.tsx @@ -1,6 +1,13 @@ -import { Avatar, Group, MantineSize, StyleProp, Text } from '@mantine/core'; +import { + Avatar, + Group, + MantineSize, + StyleProp, + Text, + Tooltip, +} from '@mantine/core'; import React, { ComponentProps } from 'react'; -import { Address } from 'viem'; +import { Address, isAddress } from 'viem'; import { useEnsAvatar, useEnsName } from 'wagmi'; import { ensConfig } from '../utils/config'; import { mainnet } from 'viem/chains'; @@ -13,11 +20,13 @@ export const AddressAvatar = ({ size = 28, fz, displayText = true, + withTooltip = false, canCopy, }: { address: Address; size?: MantineSize | number; fz?: StyleProp; + withTooltip?: boolean; displayText?: boolean; hideText?: boolean; canCopy?: boolean; @@ -54,7 +63,13 @@ export const AddressAvatar = ({ } }} > - + {withTooltip ? ( + + + + ) : ( + + )} {displayText && {name}} ); @@ -69,13 +84,17 @@ export const AddressAvatarGroup = ({ }) => { return ( - {addresses.map((address) => ( - - ))} + {addresses.map((address) => + isAddress(address) ? ( + + ) : null + )} ); }; From 2eb40b45fb3067eef37b9ddf913fd1a58f3f0f75 Mon Sep 17 00:00:00 2001 From: jordan Date: Tue, 6 Aug 2024 23:08:08 -0700 Subject: [PATCH 6/8] for ship page as well --- src/components/AddressAvatar.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/AddressAvatar.tsx b/src/components/AddressAvatar.tsx index 19af94e1..ee843863 100644 --- a/src/components/AddressAvatar.tsx +++ b/src/components/AddressAvatar.tsx @@ -64,7 +64,12 @@ export const AddressAvatar = ({ }} > {withTooltip ? ( - + ) : ( From 6ce0de3d1601b0b1a239777bad808982d8cc9126 Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 7 Aug 2024 11:53:13 -0700 Subject: [PATCH 7/8] fix demo link display --- src/components/forms/MediaForm.tsx | 43 ++++++++++++++++++++++++------ src/queries/getShipPage.ts | 1 - 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/components/forms/MediaForm.tsx b/src/components/forms/MediaForm.tsx index d5325ae8..1656078e 100644 --- a/src/components/forms/MediaForm.tsx +++ b/src/components/forms/MediaForm.tsx @@ -1,4 +1,5 @@ import { + ActionIcon, Box, Button, Divider, @@ -6,16 +7,17 @@ import { Stack, Text, TextInput, + Tooltip, } from '@mantine/core'; -import React from 'react'; + import { useMobile } from '../../hooks/useBreakpoint'; import { PageTitle } from '../../layout/Sections'; import { IconBrandVimeo, IconBrandYoutube, - IconDeviceFloppy, IconExclamationCircle, IconPhoto, + IconPlayerPlay, IconPlus, IconWorld, } from '@tabler/icons-react'; @@ -144,12 +146,37 @@ export const MediaForm = ({ form }: { form: UseFormReturnType }) => { - } - label="Demo Link" - placeholder="ex. Public Goods Death Star" - {...form.getInputProps('mainDemoLink')} - /> + + } + label="Demo Link" + description="Link to your game or app. This will be displayed front and center on your project page." + placeholder="https://your-product-demo.com" + {...form.getInputProps('mainDemoLink')} + /> + {form.values?.mainDemoLink && + form.getInputProps('mainDemoLink').error === undefined && ( + + + Test Demo + + + + + + + + )} + diff --git a/src/queries/getShipPage.ts b/src/queries/getShipPage.ts index 69b4d065..bdcf60fa 100644 --- a/src/queries/getShipPage.ts +++ b/src/queries/getShipPage.ts @@ -19,7 +19,6 @@ export const getShipPageData = async (id: string): Promise => { if (!GrantShip?.[0]) { throw new Error('No ship found'); } - console.log('GrantShip', GrantShip); const grantShip = GrantShip[0]; const pointer = grantShip?.profileMetadata?.pointer; From 3fb179297ce857164b8e35c8fab816fa73cdcb22 Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 7 Aug 2024 12:10:04 -0700 Subject: [PATCH 8/8] fix back btn on grant drawers --- src/components/PageDrawer.tsx | 9 +++++++-- src/components/grant/ApplicationDrawer.tsx | 7 ++++++- src/components/grant/FacilitatorApprovalDrawer.tsx | 2 +- src/components/grant/MilestonesDrawer.tsx | 2 +- src/components/grant/PostGrantDrawer.tsx | 7 ++++++- src/components/grant/SubmitMilestoneDrawer.tsx | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/components/PageDrawer.tsx b/src/components/PageDrawer.tsx index 95b81667..317bd9b6 100644 --- a/src/components/PageDrawer.tsx +++ b/src/components/PageDrawer.tsx @@ -7,11 +7,13 @@ export const PageDrawer = ({ pageTitle, opened, onClose, + closeOnBack = false, }: { children: ReactNode; - pageTitle?: string; + pageTitle?: string | ReactNode; opened: boolean; onClose: () => void; + closeOnBack?: boolean; }) => { return ( @@ -19,7 +21,10 @@ export const PageDrawer = ({ - + {children} diff --git a/src/components/grant/ApplicationDrawer.tsx b/src/components/grant/ApplicationDrawer.tsx index bf9f58fd..63e20e4e 100644 --- a/src/components/grant/ApplicationDrawer.tsx +++ b/src/components/grant/ApplicationDrawer.tsx @@ -192,7 +192,12 @@ export const ApplicationDrawer = ({ const alreadyHasApplication = !!currentApplication; return ( - + + + + +