@@ -9,6 +9,7 @@ import { ArrowDownCircleIcon } from "@heroicons/react/24/outline";
9
9
import { Form , useLocation , useNavigation } from "@remix-run/react" ;
10
10
import { ActionFunctionArgs } from "@remix-run/server-runtime" ;
11
11
import { PlainClient , uiComponent } from "@team-plain/typescript-sdk" ;
12
+ import { GitHubLightIcon } from "@trigger.dev/companyicons" ;
12
13
import {
13
14
FreePlanDefinition ,
14
15
Limits ,
@@ -373,7 +374,55 @@ export function TierFree({
373
374
</ div >
374
375
) : (
375
376
< >
376
- { subscription ?. plan ?. type !== "free" && subscription ?. canceledAt === undefined ? (
377
+ { status === "requires_connect" ? (
378
+ < Dialog >
379
+ < DialogTrigger asChild >
380
+ < div className = "my-6" >
381
+ < Button
382
+ type = "button"
383
+ variant = "tertiary/large"
384
+ fullWidth
385
+ className = "text-md font-medium"
386
+ disabled = { isLoading }
387
+ LeadingIcon = { isLoading ? Spinner : undefined }
388
+ >
389
+ Unlock Free plan
390
+ </ Button >
391
+ </ div >
392
+ </ DialogTrigger >
393
+ < DialogContent className = "sm:max-w-md" >
394
+ < Form action = { formAction } method = "post" id = "subscribe-free" >
395
+ < input type = "hidden" name = "type" value = "free" />
396
+ < input type = "hidden" name = "callerPath" value = { location . pathname } />
397
+ < DialogHeader > Unlock the Free plan</ DialogHeader >
398
+ < div className = "mb-5 mt-7 flex flex-col items-center gap-4 px-6" >
399
+ < GitHubLightIcon className = "size-16" />
400
+ < Paragraph variant = "base/bright" className = "text-center" >
401
+ To unlock the Free plan, we need to verify that you have an active GitHub
402
+ account.
403
+ </ Paragraph >
404
+ < Paragraph className = "text-center" >
405
+ We do this to prevent malicious use of our platform. We only ask for the
406
+ minimum permissions to verify your account.
407
+ </ Paragraph >
408
+ </ div >
409
+ < DialogFooter >
410
+ < Button
411
+ variant = "primary/large"
412
+ fullWidth
413
+ disabled = { isLoading }
414
+ LeadingIcon = { isLoading ? Spinner : undefined }
415
+ form = "subscribe-free"
416
+ >
417
+ Connect to GitHub
418
+ </ Button >
419
+ </ DialogFooter >
420
+ </ Form >
421
+ </ DialogContent >
422
+ </ Dialog >
423
+ ) : subscription ?. plan !== undefined &&
424
+ subscription . plan . type !== "free" &&
425
+ subscription . canceledAt === undefined ? (
377
426
< Dialog open = { isDialogOpen } onOpenChange = { setIsDialogOpen } key = "cancel" >
378
427
< DialogTrigger asChild >
379
428
< Button variant = "tertiary/large" fullWidth className = "text-md my-6 font-medium" >
@@ -467,8 +516,11 @@ export function TierFree({
467
516
>
468
517
{ subscription ?. plan === undefined
469
518
? "Select plan"
470
- : subscription . plan . type === "free" ||
471
- ( subscription . canceledAt !== undefined && "Current plan" ) }
519
+ : subscription . plan . type === "free"
520
+ ? "Current plan"
521
+ : subscription . canceledAt !== undefined
522
+ ? "Current plan"
523
+ : "Select plan" }
472
524
</ Button >
473
525
) }
474
526
< ul className = "flex flex-col gap-2.5" >
0 commit comments