Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

Add feature flag for not included features in plan comparison

Cursor Agent493c74fa47a7
diff --git a/components/billing/upgrade-plan-modal.tsx b/components/billing/upgrade-plan-modal.tsx
index 4ad1f236..f0b76c31 100644
--- a/components/billing/upgrade-plan-modal.tsx
+++ b/components/billing/upgrade-plan-modal.tsx
@@ -9,7 +9,7 @@ import { getStripe } from "@/ee/stripe/client";
import { Feature, PlanEnum, getPlanFeatures } from "@/ee/stripe/constants";
import { getPriceIdFromPlan } from "@/ee/stripe/functions/get-price-id-from-plan";
import { PLANS } from "@/ee/stripe/utils";
-import { CheckIcon, CircleHelpIcon, Users2Icon } from "lucide-react";
+import { CheckIcon, CircleHelpIcon, Users2Icon, XIcon } from "lucide-react";
import { useAnalytics } from "@/lib/analytics";
import { usePlan } from "@/lib/swr/use-billing";
@@ -52,7 +52,11 @@ const FeatureItem = ({ feature }: { feature: Feature }) => {
return (
<div className={cn("justify-between gap-x-8", baseClasses)}>
<div className="flex items-center gap-x-3">
- <CheckIcon className="h-5 w-5 flex-shrink-0 text-[#fb7a00]" />
+ {feature.isNotIncluded ? (
+ <XIcon className="h-5 w-5 flex-shrink-0 text-gray-500" />
+ ) : (
+ <CheckIcon className="h-5 w-5 flex-shrink-0 text-[#fb7a00]" />
+ )}
<span>{feature.text}</span>
</div>
{feature.tooltip && (
@@ -75,7 +79,11 @@ const FeatureItem = ({ feature }: { feature: Feature }) => {
return (
<div className={cn("text-sm", baseClasses)}>
- <CheckIcon className="mr-3 h-5 w-5 flex-shrink-0 text-[#fb7a00]" />
+ {feature.isNotIncluded ? (
+ <XIcon className="mr-3 h-5 w-5 flex-shrink-0 text-gray-500" />
+ ) : (
+ <CheckIcon className="mr-3 h-5 w-5 flex-shrink-0 text-[#fb7a00]" />
+ )}
<div className="flex items-center gap-2">
<span>{feature.text}</span>
{feature.tooltip && (
diff --git a/ee/stripe/constants.ts b/ee/stripe/constants.ts
index eba43320..7d5a5f42 100644
--- a/ee/stripe/constants.ts
+++ b/ee/stripe/constants.ts
@@ -25,6 +25,7 @@ export interface Feature {
isUsers?: boolean;
usersIncluded?: number;
isHighlighted?: boolean;
+ isNotIncluded?: boolean;
}
export interface PlanFeatures {
@@ -74,6 +75,7 @@ export const BASE_FEATURES: Record<PlanEnum, PlanFeatures> = {
{ id: "branding", text: "Remove Papermark branding" },
{ id: "custom-branding", text: "Custom branding" },
{ id: "retention", text: "1-year analytics retention" },
+ { id: "no-datarooms", text: "No datarooms included", isNotIncluded: true },
],
},
[PlanEnum.Business]: {
diff --git a/pages/settings/upgrade.tsx b/pages/settings/upgrade.tsx
index 819b4cab..7c978610 100644
--- a/pages/settings/upgrade.tsx
+++ b/pages/settings/upgrade.tsx
@@ -7,7 +7,7 @@ import { useTeam } from "@/context/team-context";
import { getStripe } from "@/ee/stripe/client";
import { Feature, PlanEnum, getPlanFeatures } from "@/ee/stripe/constants";
import { PLANS } from "@/ee/stripe/utils";
-import { CheckIcon, Users2Icon } from "lucide-react";
+import { CheckIcon, Users2Icon, XIcon } from "lucide-react";
import { useAnalytics } from "@/lib/analytics";
import { usePlan } from "@/lib/swr/use-billing";
@@ -36,7 +36,11 @@ const FeatureItem = ({
return (
<div className={`justify-between gap-x-8 ${baseClasses}`}>
<div className="flex items-center gap-x-3">
- <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ {feature.isNotIncluded ? (
+ <XIcon className="h-6 w-5 flex-none text-gray-500" />
+ ) : (
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ )}
<span>{feature.text}</span>
</div>
{feature.tooltip && (
@@ -60,7 +64,11 @@ const FeatureItem = ({
if (feature.isCustomDomain) {
return (
<span className={`gap-x-3 ${baseClasses}`}>
- <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ {feature.isNotIncluded ? (
+ <XIcon className="h-6 w-5 flex-none text-gray-500" />
+ ) : (
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ )}
<span>{feature.text}</span>
</span>
);
@@ -68,7 +76,11 @@ const FeatureItem = ({
return (
<div className={`gap-x-3 ${baseClasses}`}>
- <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ {feature.isNotIncluded ? (
+ <XIcon className="h-6 w-5 flex-none text-gray-500" />
+ ) : (
+ <CheckIcon className="h-6 w-5 flex-none text-[#fb7a00]" />
+ )}
<span>{feature.text}</span>
</div>
);