Skip to content

Commit 588ea30

Browse files
committed
Link to team billing page in faucet button on free plan
1 parent 73c924b commit 588ea30

File tree

1 file changed

+15
-4
lines changed
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client

1 file changed

+15
-4
lines changed

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/FaucetButton.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
33
import { Turnstile } from "@marsidev/react-turnstile";
44
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
55
import type { CanClaimResponseType } from "app/(app)/api/testnet-faucet/can-claim/CanClaimResponseType";
6+
import { ArrowUpRightIcon } from "lucide-react";
67
import Link from "next/link";
78
import { usePathname } from "next/navigation";
89
import { useForm } from "react-hook-form";
@@ -192,6 +193,20 @@ export function FaucetButton({
192193

193194
// Can not claim
194195
if (canClaimFaucetQuery.data && canClaimFaucetQuery.data.canClaim === false) {
196+
if (canClaimFaucetQuery.data.type === "paid-plan-required") {
197+
return (
198+
<Button
199+
asChild
200+
className="w-full gap-2 whitespace-pre-wrap h-auto min-h-10 text-center bg-background"
201+
variant="outline"
202+
>
203+
<Link href="/team/~/~/billing">
204+
Faucet is not available on Free plan. Upgrade your plan to continue
205+
<ArrowUpRightIcon className="size-4 shrink-0 text-muted-foreground" />
206+
</Link>
207+
</Button>
208+
);
209+
}
195210
return (
196211
<Button className="!opacity-100 w-full " disabled variant="outline">
197212
{canClaimFaucetQuery.data.type === "throttle" && (
@@ -203,10 +218,6 @@ export function FaucetButton({
203218

204219
{canClaimFaucetQuery.data.type === "unsupported-chain" &&
205220
"Faucet is empty right now"}
206-
207-
{/* TODO: add an upsell path here to subscribe to one of these plans */}
208-
{canClaimFaucetQuery.data.type === "paid-plan-required" &&
209-
"Faucet is only available on Starter, Growth, Scale and Pro plans."}
210221
</Button>
211222
);
212223
}

0 commit comments

Comments
 (0)