diff --git a/packages/nextjs/app/_components/ApplyEligibilityLink.tsx b/packages/nextjs/app/_components/ApplyEligibilityLink.tsx new file mode 100644 index 0000000..fc9979c --- /dev/null +++ b/packages/nextjs/app/_components/ApplyEligibilityLink.tsx @@ -0,0 +1,86 @@ +"use client"; + +import Link from "next/link"; +import { useConnectModal } from "@rainbow-me/rainbowkit"; +import { useAccount } from "wagmi"; +import { LockClosedIcon, LockOpenIcon } from "@heroicons/react/24/outline"; +import { useBGBuilderData } from "~~/hooks/useBGBuilderData"; + +type BuilderStatus = "notConnected" | "notMember" | "eligible"; + +const FeedbackMessage = ({ builderStatus }: { builderStatus: BuilderStatus }) => { + if (builderStatus === "notConnected") { + return ( +
+

+ 🔎 Connect your wallet to verify eligibility. +

+
+ ); + } + if (builderStatus === "notMember") { + return ( +
+

+ ❌ Not a BuidlGuidl member. +

+

+ Join by completing challenges at{" "} + + speedrunethereum.com + +

+
+ ); + } + // builderStatus is "eligible" + return ( +
+

+ ✅ You are eligible to apply! +

+

Participate in the grants program as a member.

+
+ ); +}; + +export const ApplyEligibilityLink = () => { + const { isConnected, address: connectedAddress } = useAccount(); + const { isBuilderPresent, isLoading: isFetchingBuilderData } = useBGBuilderData(connectedAddress); + const { openConnectModal } = useConnectModal(); + + const builderStatus: BuilderStatus = + !isConnected || isFetchingBuilderData ? "notConnected" : !isBuilderPresent ? "notMember" : "eligible"; + + return ( +
+

Do you qualify?

+ + {builderStatus === "eligible" ? ( + + + APPLY FOR A GRANT + + ) : ( + + )} +
+ ); +}; diff --git a/packages/nextjs/app/_components/CommunityGrant.tsx b/packages/nextjs/app/_components/CommunityGrant.tsx index 7c35b16..997ba99 100644 --- a/packages/nextjs/app/_components/CommunityGrant.tsx +++ b/packages/nextjs/app/_components/CommunityGrant.tsx @@ -1,12 +1,12 @@ import Image from "next/image"; -import Link from "next/link"; +import { ApplyEligibilityLink } from "./ApplyEligibilityLink"; export const CommunityGrant = () => { return (
{/* Left section(Title, desc and btn) */} -
+
{/* Title */}

@@ -31,12 +31,7 @@ export const CommunityGrant = () => { Are you a BG member eager to make an impact in the ecosystem? At BuidlGuidl, we're excited to support your builds. We offer sponsorships of up to 1 ETH for projects that drive the community forward.

- - Apply for a grant - +

{/* Right section (Who, process, payment, etc) */} diff --git a/packages/nextjs/tailwind.config.js b/packages/nextjs/tailwind.config.js index ebe53d0..feef71a 100644 --- a/packages/nextjs/tailwind.config.js +++ b/packages/nextjs/tailwind.config.js @@ -22,7 +22,7 @@ module.exports = { "base-content": "#212638", info: "#93BBFB", success: "#34EEB6", - warning: "#FFCF72", + warning: "#FEC297", error: "#FF8863", ".tooltip": { @@ -72,7 +72,8 @@ module.exports = { theme: { extend: { colors: { - customBlue: '#D5DAFF', + customBlue: "#D5DAFF", + customGreen: "#DDFFB3", }, boxShadow: { center: "0 0 12px -2px rgb(0 0 0 / 0.05)",