mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-30 17:59:05 +02:00
Show the right tier in the banner
This commit is contained in:
@@ -524,6 +524,7 @@ export default function BillingPage() {
|
||||
};
|
||||
|
||||
const currentPlanId = getCurrentPlanId();
|
||||
const currentPlan = planOptions.find((p) => p.id === currentPlanId);
|
||||
|
||||
const visiblePlanOptions = planOptions.filter(
|
||||
(plan) => plan.id !== "home" || currentPlanId === "home"
|
||||
@@ -873,10 +874,8 @@ export default function BillingPage() {
|
||||
{/* Trial Banner */}
|
||||
{isTrial && (
|
||||
<TrialBillingBanner
|
||||
tierName={currentPlan?.name ?? "Business"}
|
||||
onUpgrade={() => {
|
||||
const currentPlan = planOptions.find(
|
||||
(p) => p.id === currentPlanId
|
||||
);
|
||||
if (currentPlan?.tierType) {
|
||||
handleStartSubscription(currentPlan.tierType);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { Button } from "@app/components/ui/button";
|
||||
import { ClockIcon, ArrowRight } from "lucide-react";
|
||||
import { useTranslations } from "next-intl";
|
||||
@@ -8,9 +7,13 @@ import DismissableBanner from "./DismissableBanner";
|
||||
|
||||
type TrialBillingBannerProps = {
|
||||
onUpgrade: () => void;
|
||||
tierName: string;
|
||||
};
|
||||
|
||||
export const TrialBillingBanner = ({ onUpgrade }: TrialBillingBannerProps) => {
|
||||
export const TrialBillingBanner = ({
|
||||
onUpgrade,
|
||||
tierName
|
||||
}: TrialBillingBannerProps) => {
|
||||
const t = useTranslations();
|
||||
|
||||
return (
|
||||
@@ -19,7 +22,9 @@ export const TrialBillingBanner = ({ onUpgrade }: TrialBillingBannerProps) => {
|
||||
version={1}
|
||||
title={t("billingTrialBannerTitle")}
|
||||
titleIcon={<ClockIcon className="w-5 h-5 text-primary" />}
|
||||
description={t("billingTrialBannerDescription")}
|
||||
description={t("billingTrialBannerDescription", {
|
||||
tier: tierName
|
||||
})}
|
||||
dismissable={false}
|
||||
>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user