Skip to content

Commit b08b9af

Browse files
authored
BG Grants paused (#155)
1 parent c9385a6 commit b08b9af

File tree

5 files changed

+198
-79
lines changed

5 files changed

+198
-79
lines changed

packages/nextjs/app/_components/ApplyEligibilityLink.tsx

Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
"use client";
22

3+
// APPLICATIONS DISABLED - These imports are kept for when applications re-open
4+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
35
import Link from "next/link";
46
import { useConnectModal } from "@rainbow-me/rainbowkit";
57
import { useAccount } from "wagmi";
8+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
69
import { LockClosedIcon, LockOpenIcon } from "@heroicons/react/24/outline";
710
import { useSpeedRunChallengeEligibility } from "~~/hooks/useSpeedRunChallengeEligibility";
811
import { REQUIRED_CHALLENGE_COUNT } from "~~/utils/eligibility-criteria";
912

1013
type BuilderStatus = "notConnected" | "notElegible" | "eligible";
1114

15+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1216
const FeedbackMessage = ({
1317
builderStatus,
1418
completedChallengesCount,
@@ -59,10 +63,15 @@ const FeedbackMessage = ({
5963
};
6064

6165
export const ApplyEligibilityLink = () => {
66+
// APPLICATIONS DISABLED - These hooks are kept for when applications re-open
67+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6268
const { isConnected, address: connectedAddress } = useAccount();
69+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6370
const { openConnectModal } = useConnectModal();
71+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6472
const { isLoading, isEligible, completedChallengesCount } = useSpeedRunChallengeEligibility(connectedAddress);
6573

74+
/* eslint-disable @typescript-eslint/no-unused-vars */
6675
let builderStatus: BuilderStatus = "notConnected";
6776
if (!isConnected || isLoading) {
6877
builderStatus = "notConnected";
@@ -71,36 +80,55 @@ export const ApplyEligibilityLink = () => {
7180
} else {
7281
builderStatus = "notElegible";
7382
}
83+
/* eslint-enable @typescript-eslint/no-unused-vars */
7484

85+
// APPLICATIONS DISABLED - Show closed message
7586
return (
7687
<div className="mx-auto lg:m-0 flex flex-col items-start bg-white px-6 py-2 pb-6 font-spaceGrotesk space-y-1 w-4/5 rounded-2xl text-left">
77-
<p className="text-2xl font-semibold mb-0">Do you qualify?</p>
78-
<FeedbackMessage builderStatus={builderStatus} completedChallengesCount={completedChallengesCount} />
79-
{builderStatus === "eligible" ? (
80-
<Link
81-
href="/apply"
82-
className="btn px-4 md:px-8 btn-md border-1 border-black hover:border-1 hover:border-black rounded-2xl shadow-none font-medium bg-customGreen hover:bg-customGreen hover:opacity-80"
83-
>
84-
<LockOpenIcon className="h-5 w-5 mr-1 inline-block" />
85-
APPLY FOR A GRANT
86-
</Link>
87-
) : (
88-
<button
89-
className={`btn px-4 md:px-8 btn-md border-1 border-black hover:border-1 hover:border-black rounded-2xl shadow-none font-medium ${
90-
builderStatus === "notConnected" ? "btn-primary" : "btn-warning cursor-not-allowed"
91-
}`}
92-
onClick={() => {
93-
if (!isConnected && openConnectModal) openConnectModal();
94-
}}
95-
>
96-
{isLoading ? (
97-
<span className="loading loading-spinner h-5 w-5"></span>
98-
) : (
99-
<LockClosedIcon className="h-5 w-5 mr-1 inline-block" />
100-
)}
101-
{!isConnected ? "CONNECT WALLET" : "APPLY FOR A GRANT"}
102-
</button>
103-
)}
88+
<p className="text-2xl font-semibold mb-0">Applications Closed</p>
89+
<div className="leading-snug">
90+
<p>Grants applications are currently paused. We&apos;ll announce when new applications reopen. Stay tuned!</p>
91+
</div>
92+
<button
93+
className="btn px-4 md:px-8 btn-md border-1 border-black hover:border-1 hover:border-black rounded-2xl shadow-none font-medium btn-disabled cursor-not-allowed"
94+
disabled
95+
>
96+
<LockClosedIcon className="h-5 w-5 mr-1 inline-block" />
97+
APPLICATIONS CLOSED
98+
</button>
10499
</div>
105100
);
101+
102+
// ORIGINAL CODE - Uncomment to re-enable applications (and comment out the above return):
103+
// return (
104+
// <div className="mx-auto lg:m-0 flex flex-col items-start bg-white px-6 py-2 pb-6 font-spaceGrotesk space-y-1 w-4/5 rounded-2xl text-left">
105+
// <p className="text-2xl font-semibold mb-0">Do you qualify?</p>
106+
// <FeedbackMessage builderStatus={builderStatus} completedChallengesCount={completedChallengesCount} />
107+
// {builderStatus === "eligible" ? (
108+
// <Link
109+
// href="/apply"
110+
// className="btn px-4 md:px-8 btn-md border-1 border-black hover:border-1 hover:border-black rounded-2xl shadow-none font-medium bg-customGreen hover:bg-customGreen hover:opacity-80"
111+
// >
112+
// <LockOpenIcon className="h-5 w-5 mr-1 inline-block" />
113+
// APPLY FOR A GRANT
114+
// </Link>
115+
// ) : (
116+
// <button
117+
// className={`btn px-4 md:px-8 btn-md border-1 border-black hover:border-1 hover:border-black rounded-2xl shadow-none font-medium ${
118+
// builderStatus === "notConnected" ? "btn-primary" : "btn-warning cursor-not-allowed"
119+
// }`}
120+
// onClick={() => {
121+
// if (!isConnected && openConnectModal) openConnectModal();
122+
// }}
123+
// >
124+
// {isLoading ? (
125+
// <span className="loading loading-spinner h-5 w-5"></span>
126+
// ) : (
127+
// <LockClosedIcon className="h-5 w-5 mr-1 inline-block" />
128+
// )}
129+
// {!isConnected ? "CONNECT WALLET" : "APPLY FOR A GRANT"}
130+
// </button>
131+
// )}
132+
// </div>
133+
// );
106134
};

packages/nextjs/app/_components/CommunityGrant.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Image from "next/image";
2-
import { ApplyEligibilityLink } from "./ApplyEligibilityLink";
2+
3+
// import { ApplyEligibilityLink } from "./ApplyEligibilityLink";
34

45
export const CommunityGrant = () => {
56
return (
@@ -31,7 +32,15 @@ export const CommunityGrant = () => {
3132
Are you a BG member eager to make an impact in the ecosystem? At BuidlGuidl, we&apos;re excited to support
3233
your builds. We offer sponsorships starting at 0.08 ETH for projects that drive the community forward.
3334
</p>
34-
<ApplyEligibilityLink />
35+
{/* Grants Paused Notice */}
36+
<div className="mx-auto lg:m-0 flex flex-col items-start bg-white px-6 py-4 pb-6 font-spaceGrotesk space-y-2 w-4/5 rounded-2xl text-left border-2 border-warning">
37+
<p className="text-2xl font-semibold mb-0">⏸️ Grants Paused</p>
38+
<p className="text-sm leading-snug m-0">
39+
BuidlGuidl Community Grants are currently paused. We&apos;ll announce when new applications reopen. Stay
40+
tuned!
41+
</p>
42+
</div>
43+
{/* <ApplyEligibilityLink /> */}
3544
</div>
3645
</div>
3746
{/* Right section (Who, process, payment, etc) */}
Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import { NextResponse } from "next/server";
2+
// APPLICATIONS DISABLED - These imports are kept for when applications re-open
3+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
24
import { recoverTypedDataAddress } from "viem";
5+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
36
import { createGrant } from "~~/services/database/grants";
7+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
48
import { EIP_712_DOMAIN, EIP_712_TYPES__APPLY_FOR_GRANT } from "~~/utils/eip712";
9+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
510
import { REQUIRED_CHALLENGE_COUNT, fetchAcceptedChallengeCount } from "~~/utils/eligibility-criteria";
611

12+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
713
type ReqBody = {
814
title?: string;
915
description?: string;
@@ -13,49 +19,55 @@ type ReqBody = {
1319
};
1420

1521
// Hardcoded default ask amount
22+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1623
const askAmount = 0.08;
1724
// TODO: We could also add extra validation of nonce
25+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1826
export async function POST(req: Request) {
19-
try {
20-
const { title, description, signature, signer } = (await req.json()) as ReqBody;
27+
// APPLICATIONS DISABLED - Remove this return to re-enable grant submissions
28+
return NextResponse.json({ error: "Grant applications are currently closed" }, { status: 403 });
2129

22-
if (!title || !description || !signature || !signer || description.length > 750 || title.length > 75) {
23-
return NextResponse.json({ error: "Invalid form details submitted" }, { status: 400 });
24-
}
25-
26-
// Legacy BG builder presence check removed. All eligibility is now based on the new SpeedRunEthereum system. If needed we could try do some kind of ROLE validation and make sure OG BuidlGuidl members that that certain ROLE in new SRE database.
27-
const completed = await fetchAcceptedChallengeCount(signer);
28-
if (completed < REQUIRED_CHALLENGE_COUNT) {
29-
return NextResponse.json(
30-
{
31-
error: `Only builders with at least ${REQUIRED_CHALLENGE_COUNT} accepted SpeedRun Ethereum challenges can submit for grants`,
32-
},
33-
{ status: 401 },
34-
);
35-
}
36-
37-
const recoveredAddress = await recoverTypedDataAddress({
38-
domain: EIP_712_DOMAIN,
39-
types: EIP_712_TYPES__APPLY_FOR_GRANT,
40-
primaryType: "Message",
41-
message: { title, description },
42-
signature: signature,
43-
});
44-
45-
if (recoveredAddress !== signer) {
46-
return NextResponse.json({ error: "Recovered address did not match signer" }, { status: 401 });
47-
}
48-
49-
const grant = await createGrant({
50-
title: title,
51-
description: description,
52-
askAmount: askAmount,
53-
builder: signer,
54-
});
55-
56-
return NextResponse.json({ grant }, { status: 201 });
57-
} catch (e) {
58-
console.error(e);
59-
return NextResponse.json({ error: "Error processing form" }, { status: 500 });
60-
}
30+
// ORIGINAL CODE - Uncomment below and remove the return above to re-enable:
31+
// try {
32+
// const { title, description, signature, signer } = (await req.json()) as ReqBody;
33+
//
34+
// if (!title || !description || !signature || !signer || description.length > 750 || title.length > 75) {
35+
// return NextResponse.json({ error: "Invalid form details submitted" }, { status: 400 });
36+
// }
37+
//
38+
// // Legacy BG builder presence check removed. All eligibility is now based on the new SpeedRunEthereum system. If needed we could try do some kind of ROLE validation and make sure OG BuidlGuidl members that that certain ROLE in new SRE database.
39+
// const completed = await fetchAcceptedChallengeCount(signer);
40+
// if (completed < REQUIRED_CHALLENGE_COUNT) {
41+
// return NextResponse.json(
42+
// {
43+
// error: `Only builders with at least ${REQUIRED_CHALLENGE_COUNT} accepted SpeedRun Ethereum challenges can submit for grants`,
44+
// },
45+
// { status: 401 },
46+
// );
47+
// }
48+
//
49+
// const recoveredAddress = await recoverTypedDataAddress({
50+
// domain: EIP_712_DOMAIN,
51+
// types: EIP_712_TYPES__APPLY_FOR_GRANT,
52+
// primaryType: "Message",
53+
// message: { title, description },
54+
// signature: signature,
55+
// });
56+
//
57+
// if (recoveredAddress !== signer) {
58+
// return NextResponse.json({ error: "Recovered address did not match signer" }, { status: 401 });
59+
// }
60+
//
61+
// const grant = await createGrant({
62+
// title: title,
63+
// description: description,
64+
// askAmount: askAmount,
65+
// builder: signer,
66+
// });
67+
//
68+
// return NextResponse.json({ grant }, { status: 201 });
69+
// } catch (e) {
70+
// console.error(e);
71+
// return NextResponse.json({ error: "Error processing form" }, { status: 500 });
72+
// }
6173
}

packages/nextjs/app/apply/page.tsx

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,88 @@
1-
import Form from "./_component/Form";
1+
// APPLICATIONS DISABLED - Uncomment below to re-enable
2+
// import Form from "./_component/Form";
3+
import Image from "next/image";
4+
import Link from "next/link";
25
import { NextPage } from "next";
36

47
const SubmitGrant: NextPage = () => {
8+
// APPLICATIONS DISABLED - Replace this return block with the commented one below to re-enable
59
return (
6-
<div className="flex bg-base-100 items-center flex-col flex-grow text-center pt-10 md:pt-4 px-6">
7-
<h1 className="text-3xl sm:text-4xl font-bold mb-4">Apply for a Community Grant</h1>
8-
<p className="text-md mb-0 max-w-xl">
9-
Our focus with these grants is primarily on code-based initiatives. Community events, workshops and other
10-
speaking engagements will be rejected unless your suggestion is especially unique and compelling.
10+
<div className="flex bg-base-100 items-center flex-col flex-grow text-center pt-10 md:pt-16 px-6">
11+
{/* Visual illustration with patches */}
12+
<div className="relative w-64 h-48 md:w-80 md:h-56 mb-8">
13+
<div className="absolute -rotate-12 left-0 top-4 h-[100px] w-[100px] md:h-[140px] md:w-[140px]">
14+
<Image src="/assets/blue-patch.png" alt="Decorative patch" fill className="opacity-60" />
15+
</div>
16+
<div className="absolute rotate-6 right-0 top-0 h-[90px] w-[90px] md:h-[130px] md:w-[130px]">
17+
<Image src="/assets/orange-patch.png" alt="Decorative patch" fill className="opacity-60" />
18+
</div>
19+
<div className="absolute -rotate-3 left-1/4 bottom-0 h-[80px] w-[80px] md:h-[110px] md:w-[110px]">
20+
<Image src="/assets/gray-patch.png" alt="Decorative patch" fill className="opacity-70" />
21+
</div>
22+
{/* Paused icon overlay */}
23+
<div className="absolute inset-0 flex items-center justify-center">
24+
<div className="bg-white rounded-full p-4 shadow-lg">
25+
<svg
26+
xmlns="http://www.w3.org/2000/svg"
27+
fill="none"
28+
viewBox="0 0 24 24"
29+
strokeWidth={2}
30+
stroke="currentColor"
31+
className="w-12 h-12 md:w-16 md:h-16 text-gray-600"
32+
>
33+
<path strokeLinecap="round" strokeLinejoin="round" d="M15.75 5.25v13.5m-7.5-13.5v13.5" />
34+
</svg>
35+
</div>
36+
</div>
37+
</div>
38+
39+
{/* Title with sparkle */}
40+
<div className="relative">
41+
<h1 className="text-3xl sm:text-4xl lg:text-5xl font-ppEditorial mb-4">Applications Paused</h1>
42+
<Image
43+
className="absolute -top-2 -right-5 md:-top-3 md:-right-7"
44+
src="/assets/sparkle.png"
45+
alt="sparkle"
46+
width={28}
47+
height={28}
48+
/>
49+
</div>
50+
51+
<p className="text-md mb-0 max-w-xl text-gray-600 font-spaceMono">
52+
Grant applications are currently closed. We&apos;re preparing for the next round of grants.
53+
<br />
54+
Check back soon for updates!
1155
</p>
12-
<p className="text-md pb-6 max-w-xl">We are excited to support your projects to drive the community forward.</p>
13-
<Form />
56+
57+
<div className="flex flex-col sm:flex-row gap-4 mt-8">
58+
<Link
59+
href="/"
60+
className="btn btn-primary btn-md border-1 border-black hover:border-black rounded-2xl px-8 font-medium shadow-none"
61+
>
62+
Return Home
63+
</Link>
64+
<Link
65+
href="/#communityGrants"
66+
className="btn btn-outline btn-md border-1 border-black hover:border-black rounded-2xl px-8 font-medium shadow-none"
67+
>
68+
Learn About Grants
69+
</Link>
70+
</div>
1471
</div>
1572
);
73+
74+
// ORIGINAL CODE - Uncomment to re-enable applications:
75+
// return (
76+
// <div className="flex bg-base-100 items-center flex-col flex-grow text-center pt-10 md:pt-4 px-6">
77+
// <h1 className="text-3xl sm:text-4xl font-bold mb-4">Apply for a Community Grant</h1>
78+
// <p className="text-md mb-0 max-w-xl">
79+
// Our focus with these grants is primarily on code-based initiatives. Community events, workshops and other
80+
// speaking engagements will be rejected unless your suggestion is especially unique and compelling.
81+
// </p>
82+
// <p className="text-md pb-6 max-w-xl">We are excited to support your projects to drive the community forward.</p>
83+
// <Form />
84+
// </div>
85+
// );
1686
};
1787

1888
export default SubmitGrant;

packages/nextjs/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

0 commit comments

Comments
 (0)