diff --git a/packages/nextjs/app/apply/page.tsx b/packages/nextjs/app/apply/page.tsx index 5b8e7c2..994e32f 100644 --- a/packages/nextjs/app/apply/page.tsx +++ b/packages/nextjs/app/apply/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect } from "react"; +import { useEffect, useRef } from "react"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { CreateNewGrantReqBody } from "../api/grants/new/route"; @@ -9,6 +9,7 @@ import { useConnectModal } from "@rainbow-me/rainbowkit"; import { useMutation } from "@tanstack/react-query"; import type { NextPage } from "next"; import { FormProvider } from "react-hook-form"; +import { Toaster } from "react-hot-toast"; import { useAccount } from "wagmi"; import { Button } from "~~/components/pg-ens/Button"; import { FormInput } from "~~/components/pg-ens/form-fields/FormInput"; @@ -29,6 +30,8 @@ const Apply: NextPage = () => { const { openConnectModal } = useConnectModal(); const { isAuthenticated } = useAuthSession(); + const feedbackModalRef = useRef(null); + useEffect(() => { if (isAuthenticated) { router.refresh(); @@ -47,16 +50,46 @@ const Apply: NextPage = () => { ...fieldValues, }); notification.success(`The grant proposal has been created`); - router.push("/my-grants"); + feedbackModalRef.current?.showModal(); } catch (error) { const errorMessage = getParsedError(error); notification.error(errorMessage); } }; + const handleModalClose = () => { + feedbackModalRef.current?.close(); + router.push("/my-grants"); + }; + return (

Apply for a grant

+

+ Open to all public goods projects. ENS-specific projects should apply through the ENS Ecosystem Grants program + instead. +

+ + +
+
+
+

Application Submitted Successfully!

+
+
+ +
+

+ Grant applications are reviewed at a regular cadence, you will receive information if we need more info, + if the application was rejected and why, or approved and for what amount, based on the info submitted. +

+
+ +
+
+
+ +
diff --git a/packages/nextjs/app/grants/[grantId]/_components/CurrentStage/NewStageModal/index.tsx b/packages/nextjs/app/grants/[grantId]/_components/CurrentStage/NewStageModal/index.tsx index 5c2ce6f..b439f0b 100644 --- a/packages/nextjs/app/grants/[grantId]/_components/CurrentStage/NewStageModal/index.tsx +++ b/packages/nextjs/app/grants/[grantId]/_components/CurrentStage/NewStageModal/index.tsx @@ -1,4 +1,4 @@ -import { forwardRef } from "react"; +import { forwardRef, useRef } from "react"; import { useRouter } from "next/navigation"; import { NewStageModalFormValues, newStageModalFormSchema } from "./schema"; import { useMutation } from "@tanstack/react-query"; @@ -27,6 +27,7 @@ export const NewStageModal = forwardRef( schema: newStageModalFormSchema, }); const { handleSubmit } = formMethods; + const feedbackModalRef = useRef(null); const onSubmit = async (fieldValues: NewStageModalFormValues) => { try { @@ -44,12 +45,13 @@ export const NewStageModal = forwardRef( await postNewStage({ milestone, signature, grantId }); closeModal(); - router.refresh(); + feedbackModalRef.current?.showModal(); } catch (error) { const errorMessage = getParsedError(error); notification.error(errorMessage); } }; + const { signTypedDataAsync, isPending: isSigning } = useSignTypedData(); const router = useRouter(); @@ -58,33 +60,61 @@ export const NewStageModal = forwardRef( postMutationFetcher("/api/stages/new", { body: newStageBody }), }); + const handleFeedbackModalClose = () => { + feedbackModalRef.current?.close(); + router.refresh(); + }; + return ( - -
-
-
-

Stage {previousStage.stageNumber + 1} application

-
- {/* if there is a button in form, it will close the modal */} - -
- -
- - + <> + +
+ +
+

Stage {previousStage.stageNumber + 1} application

+
+ {/* if there is a button in form, it will close the modal */} + - -
- -
+ +
+ + + +
+
+ +
+ + +
+
+
+

Stage Application Submitted!

+
+
+ +
+

+ Your stage application will be reviewed. You will receive information if we need more details, if the + application was rejected and why, or when it is approved and for what amount. +

+
+ +
+
+
+ +
+ ); }, ); diff --git a/packages/nextjs/app/page.tsx b/packages/nextjs/app/page.tsx index 56eb7d1..fb90f25 100644 --- a/packages/nextjs/app/page.tsx +++ b/packages/nextjs/app/page.tsx @@ -34,17 +34,16 @@ const Home: NextPage = () => {

ENS PG Builder Grants

-
+

- The ENS PG Builder Grants program is designed to support foundational public goods in the Ethereum and Web3 + PG Builder Grants program is designed to support foundational public goods in the Ethereum and Web3 ecosystems. The program aims to empower projects that have demonstrated exceptional usefulness and impact for developers and users alike.

By providing significant financial support, we help projects continue to drive innovation and growth within the ecosystem. Whether you're building infrastructure, developing tools, or creating educational - resources, the ENS PG Builder Grants offer a pathway to secure the funding you need to make a lasting - difference. + resources, PG Builder Grants offer a pathway to secure the funding you need to make a lasting difference.