Skip to content

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

feat: add conversationsInDataroom to plan

Marc Seitz37843b3a18ef
diff --git a/components/datarooms/dataroom-navigation.tsx b/components/datarooms/dataroom-navigation.tsx
index 3dc855a3..59d47cfd 100644
--- a/components/datarooms/dataroom-navigation.tsx
+++ b/components/datarooms/dataroom-navigation.tsx
@@ -29,7 +29,7 @@ export const DataroomNavigation = ({ dataroomId }: { dataroomId?: string }) => {
label: "Q&A Conversations",
href: `/datarooms/${dataroomId}/conversations`,
segment: "conversations",
- disabled: !limits?.conversationsInDataroom,
+ limited: !limits?.conversationsInDataroom,
},
{
label: "Branding",
diff --git a/components/navigation-menu.tsx b/components/navigation-menu.tsx
index 8f655c73..63c17f2f 100644
--- a/components/navigation-menu.tsx
+++ b/components/navigation-menu.tsx
@@ -5,10 +5,15 @@ import { useRouter } from "next/router";
import * as React from "react";
-import { Separator } from "@/components/ui/separator";
+import { PlanEnum } from "@/ee/stripe/constants";
+import { CrownIcon } from "lucide-react";
import { cn } from "@/lib/utils";
+import { Separator } from "@/components/ui/separator";
+
+import { UpgradePlanModal } from "./billing/upgrade-plan-modal";
+
type Props = {
navigation: {
label: string;
@@ -16,6 +21,7 @@ type Props = {
segment: string | null;
tag?: string;
disabled?: boolean;
+ limited?: boolean;
}[];
className?: string;
};
@@ -30,16 +36,19 @@ export const NavMenu: React.FC<React.PropsWithChildren<Props>> = ({
>
<div className="flex w-full items-center overflow-x-auto px-4 pl-1">
<ul className="flex flex-row gap-4">
- {navigation.map(({ label, href, segment, tag, disabled }) => (
- <NavItem
- key={label}
- label={label}
- href={href}
- segment={segment}
- tag={tag}
- disabled={disabled}
- />
- ))}
+ {navigation.map(
+ ({ label, href, segment, tag, disabled, limited }) => (
+ <NavItem
+ key={label}
+ label={label}
+ href={href}
+ segment={segment}
+ tag={tag}
+ disabled={disabled}
+ limited={limited}
+ />
+ ),
+ )}
</ul>
</div>
<Separator />
@@ -53,6 +62,7 @@ const NavItem: React.FC<Props["navigation"][0]> = ({
segment,
tag,
disabled,
+ limited,
}) => {
const router = useRouter();
// active is true if the segment included in the pathname, but not if it's the root pathname. unless the segment is the root pathname.
@@ -75,11 +85,11 @@ const NavItem: React.FC<Props["navigation"][0]> = ({
return (
<li
+ key={label}
className={cn(
"flex shrink-0 list-none border-b-2 border-transparent p-2",
{
"border-primary": active,
- // "animate-pulse": isPending,
hidden: disabled,
},
)}
diff --git a/components/sidebar/nav-main.tsx b/components/sidebar/nav-main.tsx
index bfa5e5bb..57cdc5be 100644
--- a/components/sidebar/nav-main.tsx
+++ b/components/sidebar/nav-main.tsx
@@ -5,6 +5,8 @@ import Link from "next/link";
import { PlanEnum } from "@/ee/stripe/constants";
import { ChevronRight, CrownIcon, type LucideIcon } from "lucide-react";
+import { cn } from "@/lib/utils";
+
import {
Collapsible,
CollapsibleContent,
@@ -22,8 +24,6 @@ import {
SidebarMenuSubItem,
} from "@/components/ui/sidebar";
-import { cn } from "@/lib/utils";
-
import { UpgradePlanModal } from "../billing/upgrade-plan-modal";
export interface NavItem {
diff --git a/ee/limits/constants.ts b/ee/limits/constants.ts
index 773cd493..11100c75 100644
--- a/ee/limits/constants.ts
+++ b/ee/limits/constants.ts
@@ -64,5 +64,6 @@ export const DATAROOMS_PLUS_PLAN_LIMITS = {
datarooms: 1000,
customDomainOnPro: true,
customDomainInDataroom: true,
+ conversationsInDataroom: true,
advancedLinkControlsOnPro: false,
};