Skip to content

Commit 36cd7a9

Browse files
committed
Updated the pricing panels
1 parent 6ab5a07 commit 36cd7a9

File tree

3 files changed

+57
-6
lines changed

3 files changed

+57
-6
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing/route.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export async function loader({ params, request }: LoaderFunctionArgs) {
8383
export default function ChoosePlanPage() {
8484
const {
8585
plans,
86+
addOnPricing,
8687
v3Subscription,
8788
organizationSlug,
8889
periodStart,
@@ -141,6 +142,7 @@ export default function ChoosePlanPage() {
141142
<div>
142143
<PricingPlans
143144
plans={plans}
145+
concurrencyAddOnPricing={addOnPricing.concurrency}
144146
subscription={v3Subscription}
145147
organizationSlug={organizationSlug}
146148
hasPromotedPlan={false}

apps/webapp/app/routes/_app.orgs.$organizationSlug_.select-plan/route.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export async function loader({ params, request }: LoaderFunctionArgs) {
4545
}
4646

4747
export default function ChoosePlanPage() {
48-
const { plans, v3Subscription, organizationSlug, periodEnd } =
48+
const { plans, v3Subscription, organizationSlug, periodEnd, addOnPricing } =
4949
useTypedLoaderData<typeof loader>();
5050

5151
return (
@@ -57,6 +57,7 @@ export default function ChoosePlanPage() {
5757
<div className="w-full rounded-lg border border-grid-bright bg-background-dimmed p-5 shadow-lg">
5858
<PricingPlans
5959
plans={plans}
60+
concurrencyAddOnPricing={addOnPricing.concurrency}
6061
subscription={v3Subscription}
6162
organizationSlug={organizationSlug}
6263
hasPromotedPlan

apps/webapp/app/routes/resources.orgs.$organizationSlug.select-plan.tsx

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { type ActionFunctionArgs } from "@remix-run/server-runtime";
1111
import { uiComponent } from "@team-plain/typescript-sdk";
1212
import { GitHubLightIcon } from "@trigger.dev/companyicons";
1313
import {
14+
AddOnPricing,
1415
type FreePlanDefinition,
1516
type Limits,
1617
type PaidPlanDefinition,
@@ -45,6 +46,8 @@ import { requireUser } from "~/services/session.server";
4546
import { engine } from "~/v3/runEngine.server";
4647
import { cn } from "~/utils/cn";
4748
import { sendToPlain } from "~/utils/plain.server";
49+
import { formatCurrency } from "~/utils/numberFormatter";
50+
import { EnvironmentLabel } from "~/components/environments/EnvironmentLabel";
4851

4952
const Params = z.object({
5053
organizationSlug: z.string(),
@@ -173,7 +176,6 @@ const pricingDefinitions = {
173176
},
174177
additionalConcurrency: {
175178
title: "Additional concurrency",
176-
content: "Then $50/month per 50",
177179
},
178180
taskRun: {
179181
title: "Task runs",
@@ -227,6 +229,7 @@ const pricingDefinitions = {
227229

228230
type PricingPlansProps = {
229231
plans: Plans;
232+
concurrencyAddOnPricing: AddOnPricing;
230233
subscription?: SubscriptionResult;
231234
organizationSlug: string;
232235
hasPromotedPlan: boolean;
@@ -236,6 +239,7 @@ type PricingPlansProps = {
236239

237240
export function PricingPlans({
238241
plans,
242+
concurrencyAddOnPricing,
239243
subscription,
240244
organizationSlug,
241245
hasPromotedPlan,
@@ -258,7 +262,12 @@ export function PricingPlans({
258262
subscription={subscription}
259263
isHighlighted={hasPromotedPlan}
260264
/>
261-
<TierPro plan={plans.pro} organizationSlug={organizationSlug} subscription={subscription} />
265+
<TierPro
266+
plan={plans.pro}
267+
organizationSlug={organizationSlug}
268+
subscription={subscription}
269+
concurrencyAddOnPricing={concurrencyAddOnPricing}
270+
/>
262271
</div>
263272
<div className="mt-3">
264273
<TierEnterprise />
@@ -654,10 +663,12 @@ export function TierHobby({
654663

655664
export function TierPro({
656665
plan,
666+
concurrencyAddOnPricing,
657667
organizationSlug,
658668
subscription,
659669
}: {
660670
plan: PaidPlanDefinition;
671+
concurrencyAddOnPricing: AddOnPricing;
661672
organizationSlug: string;
662673
subscription?: SubscriptionResult;
663674
}) {
@@ -747,7 +758,9 @@ export function TierPro({
747758
</Form>
748759
<ul className="flex flex-col gap-2.5">
749760
<ConcurrentRuns limits={plan.limits}>
750-
{pricingDefinitions.additionalConcurrency.content}
761+
{`Then ${formatCurrency(concurrencyAddOnPricing.centsPerStep / 100, true)}/month per ${
762+
concurrencyAddOnPricing.stepSize
763+
}`}
751764
</ConcurrentRuns>
752765
<FeatureItem checked>
753766
Unlimited{" "}
@@ -963,10 +976,45 @@ function ConcurrentRuns({ limits, children }: { limits: Limits; children?: React
963976
</>
964977
) : (
965978
<>{limits.concurrentRuns.number} </>
966-
)}{" "}
979+
)}
967980
<DefinitionTip
968981
title={pricingDefinitions.concurrentRuns.title}
969-
content={pricingDefinitions.concurrentRuns.content}
982+
content={
983+
<div className="flex flex-col">
984+
<Paragraph variant="small/dimmed" spacing>
985+
{pricingDefinitions.concurrentRuns.content}
986+
</Paragraph>
987+
988+
<div className="flex items-center gap-x-1">
989+
<EnvironmentLabel environment={{ type: "PRODUCTION" }} />
990+
<span>
991+
{limits.concurrentRuns.production}
992+
{limits.concurrentRuns.canExceed ? "+" : ""}
993+
</span>
994+
</div>
995+
<div className="flex items-center gap-x-1">
996+
<EnvironmentLabel environment={{ type: "STAGING" }} />
997+
<span>
998+
{limits.concurrentRuns.staging}
999+
{limits.concurrentRuns.canExceed ? "+" : ""}
1000+
</span>
1001+
</div>
1002+
<div className="flex items-center gap-x-1">
1003+
<EnvironmentLabel environment={{ type: "PREVIEW" }} />
1004+
<span>
1005+
{limits.concurrentRuns.preview}
1006+
{limits.concurrentRuns.canExceed ? "+" : ""}
1007+
</span>
1008+
</div>
1009+
<div className="flex items-center gap-x-1">
1010+
<EnvironmentLabel environment={{ type: "DEVELOPMENT" }} />
1011+
<span>
1012+
{limits.concurrentRuns.development}
1013+
{limits.concurrentRuns.canExceed ? "+" : ""}
1014+
</span>
1015+
</div>
1016+
</div>
1017+
}
9701018
>
9711019
concurrent runs
9721020
</DefinitionTip>

0 commit comments

Comments
 (0)