Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
chore: cleanup pricing
Marc Seitzb6bcf8a589fc
diff --git a/components/billing/upgrade-plan-modal.tsx b/components/billing/upgrade-plan-modal.tsxindex 354bdc74..15423544 100644--- a/components/billing/upgrade-plan-modal.tsx+++ b/components/billing/upgrade-plan-modal.tsx@@ -42,22 +42,22 @@ export function UpgradePlanModal({const features = useMemo(() => {if (plan === "Pro") {return [- "2 users",+ "2 users included","Custom branding","1-year analytics retention",- "Advanced access controls","Folder organization",];}if (plan === "Business") {return [- "3 users",+ "3 users included","1 dataroom","Multi-file sharing",<span key="custom-domain">Custom domain <b>for documents</b></span>,+ "Advanced link controls","Unlimited documents","Unlimited subfolder levels","Large file uploads",@@ -66,7 +66,7 @@ export function UpgradePlanModal({}if (plan === "Data Rooms") {return [- "5 users included",+ "3 users included","Unlimited data rooms",<span key="custom-dataroom">Custom domain <b>for data rooms</b>@@ -84,7 +84,6 @@ export function UpgradePlanModal({"2 users","Custom branding","1-year analytics retention",- "Advanced access controls","Folders",];}, [plan]);@@ -197,9 +196,11 @@ export function UpgradePlanModal({className="text-xs text-muted-foreground underline underline-offset-4 transition-colors hover:text-gray-800 hover:dark:text-muted-foreground/80">{period === "monthly"- ? ["Business", "Data Rooms"].includes(plan)- ? "Want 25% off?"- : "Want 35% off?"+ ? plan === "Business"+ ? "Want 43% off?"+ : plan === "Data Rooms"+ ? "Want 50% off?"+ : "Want 35% off?": "Switch to monthly"}</button></div>diff --git a/components/links/link-sheet/link-options.tsx b/components/links/link-sheet/link-options.tsxindex ac7a12b8..570b580e 100644--- a/components/links/link-sheet/link-options.tsx+++ b/components/links/link-sheet/link-options.tsx@@ -1,4 +1,4 @@-import { Dispatch, SetStateAction, useState } from "react";+import { useState } from "react";import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";import { DEFAULT_LINK_TYPE } from "@/components/links/link-sheet";@@ -20,19 +20,27 @@ import {} from "@/components/ui/accordion";import { usePlan } from "@/lib/swr/use-billing";+import useLimits from "@/lib/swr/use-limits";import AgreementSection from "./agreement-section";import QuestionSection from "./question-section";import ScreenshotProtectionSection from "./screenshot-protection-section";+export type LinkUpgradeOptions = {+ state: boolean;+ trigger: string;+ plan?: "Pro" | "Business" | "Data Rooms";+};+export const LinkOptions = ({data,setData,}: {data: DEFAULT_LINK_TYPE;- setData: Dispatch<SetStateAction<DEFAULT_LINK_TYPE>>;+ setData: React.Dispatch<React.SetStateAction<DEFAULT_LINK_TYPE>>;}) => {const { plan } = usePlan();+ const { limits } = useLimits();const hasFreePlan = plan === "free";const isNotBusiness = plan !== "business";const isNotDatarooms = plan !== "datarooms";@@ -41,13 +49,13 @@ export const LinkOptions = ({const [trigger, setTrigger] = useState<string>("");const [upgradePlan, setUpgradePlan] = useState<"Pro" | "Business" | "Data Rooms"- >("Pro");+ >("Business");- const handleUpgradeStateChange = (- state: boolean,- trigger: string,- plan?: "Pro" | "Business" | "Data Rooms",- ) => {+ const handleUpgradeStateChange = ({+ state,+ trigger,+ plan,+ }: LinkUpgradeOptions) => {setOpenUpgradeModal(state);setTrigger(trigger);if (plan) {@@ -63,7 +71,9 @@ export const LinkOptions = ({<ExpirationSection {...{ data, setData }} /><OGSection{...{ data, setData }}- hasFreePlan={hasFreePlan}+ hasFreePlan={+ isNotBusiness && isNotDatarooms && !limits?.advancedLinkControlsOnPro+ }handleUpgradeStateChange={handleUpgradeStateChange}/>@@ -82,24 +92,40 @@ export const LinkOptions = ({/><AllowListSection{...{ data, setData }}- hasFreePlan={hasFreePlan}+ hasFreePlan={+ isNotBusiness &&+ isNotDatarooms &&+ !limits?.advancedLinkControlsOnPro+ }handleUpgradeStateChange={handleUpgradeStateChange}/><DenyListSection{...{ data, setData }}- hasFreePlan={hasFreePlan}+ hasFreePlan={+ isNotBusiness &&+ isNotDatarooms &&+ !limits?.advancedLinkControlsOnPro+ }handleUpgradeStateChange={handleUpgradeStateChange}/><PasswordSection {...{ data, setData }} /><ScreenshotProtectionSection{...{ data, setData }}- hasFreePlan={isNotBusiness && isNotDatarooms}+ hasFreePlan={+ isNotBusiness &&+ isNotDatarooms &&+ !limits?.advancedLinkControlsOnPro+ }handleUpgradeStateChange={handleUpgradeStateChange}/><FeedbackSection {...{ data, setData }} /><QuestionSection{...{ data, setData }}- hasFreePlan={isNotBusiness && isNotDatarooms}+ hasFreePlan={+ isNotBusiness &&+ isNotDatarooms &&+ !limits?.advancedLinkControlsOnPro+ }handleUpgradeStateChange={handleUpgradeStateChange}/><AgreementSectiondiff --git a/ee/limits/constants.ts b/ee/limits/constants.tsindex c122a7ce..df831c30 100644--- a/ee/limits/constants.ts+++ b/ee/limits/constants.ts@@ -4,6 +4,7 @@ export const FREE_PLAN_LIMITS = {datarooms: 0,customDomainOnPro: false,customDomainInDataroom: false,+ advancedLinkControlsOnPro: false,};export const PRO_PLAN_LIMITS = {@@ -12,6 +13,7 @@ export const PRO_PLAN_LIMITS = {datarooms: 0,customDomainOnPro: false,customDomainInDataroom: false,+ advancedLinkControlsOnPro: false,};export const BUSINESS_PLAN_LIMITS = {@@ -20,6 +22,7 @@ export const BUSINESS_PLAN_LIMITS = {datarooms: 1,customDomainOnPro: true,customDomainInDataroom: false,+ advancedLinkControlsOnPro: false,};export const DATAROOMS_PLAN_LIMITS = {@@ -28,4 +31,5 @@ export const DATAROOMS_PLAN_LIMITS = {datarooms: 100,customDomainOnPro: true,customDomainInDataroom: true,+ advancedLinkControlsOnPro: false,};diff --git a/ee/limits/server.ts b/ee/limits/server.tsindex 2a9cdbb2..7956d748 100644--- a/ee/limits/server.ts+++ b/ee/limits/server.ts@@ -37,6 +37,7 @@ export async function getLimits({domains: z.number(),customDomainOnPro: z.boolean(),customDomainInDataroom: z.boolean(),+ advancedLinkControlsOnPro: z.boolean().nullish(),});try {diff --git a/ee/limits/swr-handler.ts b/ee/limits/swr-handler.tsindex 1aa229fb..4c027029 100644--- a/ee/limits/swr-handler.ts+++ b/ee/limits/swr-handler.ts@@ -9,6 +9,7 @@ export type LimitProps = {domains: number;customDomainOnPro: boolean;customDomainInDataroom: boolean;+ advancedLinkControlsOnPro: boolean;};export function useLimits() {diff --git a/pages/pricing.tsx b/pages/pricing.tsxindex d7dc2345..6adcdab4 100644--- a/pages/pricing.tsx+++ b/pages/pricing.tsx@@ -71,7 +71,6 @@ const tiers: {"2 users included","Custom branding","1-year analytics retention",- "Advanced access controls","Folder organization",],bgColor: "bg-gray-200",@@ -84,13 +83,14 @@ const tiers: {name: "Business",id: "tier-business",href: "/login",- price: { monthly: "€79", annually: "€59" },+ price: { monthly: "€79", annually: "€45" },description: "The one for more control, data room, and multi-file sharing.",featureIntro: "Everything in Pro, plus:",features: ["3 users included","1 dataroom","Custom domain for documents",+ "Advanced link controls","Multi-file sharing","Unlimited documents","Unlimited subfolder levels",@@ -107,7 +107,7 @@ const tiers: {name: "Data Rooms",id: "tier-datarooms",href: "/login",- price: { monthly: "€199", annually: "€149" },+ price: { monthly: "€199", annually: "€99" },description: "Advanced data rooms infrastructure for your company.",featureIntro: "Everything in Business, plus:",features: [@@ -315,7 +315,7 @@ export default function PricingPage() {: "hidden",)}/>- 25% Saving+ 43% Saving</div></div>) : null}@@ -363,7 +363,7 @@ export default function PricingPage() {: "hidden",)}/>- 25% Saving+ 50% Saving</div></div>) : null}diff --git a/pages/settings/billing.tsx b/pages/settings/billing.tsxindex ee77bdfc..1173c2da 100644--- a/pages/settings/billing.tsx+++ b/pages/settings/billing.tsx@@ -127,10 +127,9 @@ export default function Billing() {description: "The branded experience for your documents.",featureIntro: "Everything in Free, plus:",features: [- "2 users",+ "2 users included","Custom branding","1-year analytics retention",- "Advanced access controls","Folder organization",],bgColor: "bg-gray-200",@@ -144,14 +143,15 @@ export default function Billing() {id: "tier-business",href: "/login",currentPlan: plan && plan == "business" ? true : false,- price: { monthly: "€79", annually: "€59" },+ price: { monthly: "€79", annually: "€45" },description:"The one for more control, data room, and multi-file sharing.",featureIntro: "Everything in Pro, plus:",features: [- "3 users",+ "3 users included","1 dataroom","Multi-file sharing",+ "Advanced link controls","Custom domain for documents","Unlimited documents","Unlimited subfolder levels",@@ -170,12 +170,12 @@ export default function Billing() {id: "tier-datarooms",href: "/login",currentPlan: plan && plan == "datarooms" ? true : false,- price: { monthly: "€199", annually: "€149" },+ price: { monthly: "€199", annually: "€99" },description:"The one for more control, data room, and multi-file sharing.",- featureIntro: "Everything in Pro, plus:",+ featureIntro: "Everything in Business, plus:",features: [- "5 users included",+ "3 users included","Unlimited data rooms","Custom domain for data rooms","Unlimited documents",@@ -265,7 +265,7 @@ export default function Billing() {className={cn(toggleProYear? "text-gray-400"- : "text-foreground ",+ : "text-foreground",)}>Monthly@@ -274,7 +274,7 @@ export default function Billing() {<spanclassName={cn(toggleProYear- ? "text-foreground "+ ? "text-foreground": "text-gray-400",)}>@@ -313,7 +313,7 @@ export default function Billing() {className={cn(toggleBusinessYear? "text-gray-400"- : "text-foreground ",+ : "text-foreground",)}>Monthly@@ -322,7 +322,7 @@ export default function Billing() {<spanclassName={cn(toggleBusinessYear- ? "text-foreground "+ ? "text-foreground": "text-gray-400",)}>@@ -343,7 +343,7 @@ export default function Billing() {: "hidden",)}/>- 25% Saving+ 43% Saving</div></div>) : null}@@ -391,7 +391,7 @@ export default function Billing() {: "hidden",)}/>- 25% Saving+ 50% Saving</div></div>) : null}@@ -406,7 +406,7 @@ export default function Billing() {</div><p className="mt-6 flex items-baseline gap-x-1"><span- className="text-balance text-4xl font-medium text-foreground "+ className="text-balance text-4xl font-medium text-foreground"style={{ fontVariantNumeric: "tabular-nums" }}>{tier.id === "tier-pro"