Skip to content

Commit 4644f07

Browse files
committed
feat: disable banner for datarooms
1 parent a0ba22c commit 4644f07

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

components/links/link-sheet/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { LinkOptions } from "./link-options";
4646
export const DEFAULT_LINK_PROPS = (
4747
linkType: LinkType,
4848
groupId: string | null = null,
49+
showBanner: boolean = true,
4950
) => ({
5051
id: null,
5152
name: null,
@@ -71,7 +72,7 @@ export const DEFAULT_LINK_PROPS = (
7172
questionType: null,
7273
enableAgreement: false,
7374
agreementId: null,
74-
showBanner: linkType === LinkType.DOCUMENT_LINK ? true : false,
75+
showBanner: linkType === LinkType.DOCUMENT_LINK ? showBanner : false,
7576
enableWatermark: false,
7677
watermarkConfig: null,
7778
audienceType: groupId ? LinkAudienceType.GROUP : LinkAudienceType.GENERAL,
@@ -141,13 +142,13 @@ export default function LinkSheet({
141142
const { isFree, isDatarooms, isDataroomsPlus, isTrial } = usePlan();
142143
const analytics = useAnalytics();
143144
const [data, setData] = useState<DEFAULT_LINK_TYPE>(
144-
DEFAULT_LINK_PROPS(linkType, groupId),
145+
DEFAULT_LINK_PROPS(linkType, groupId, !isDatarooms),
145146
);
146147
const [isLoading, setIsLoading] = useState<boolean>(false);
147148
const [isSaving, setIsSaving] = useState<boolean>(false);
148149

149150
useEffect(() => {
150-
setData(currentLink || DEFAULT_LINK_PROPS(linkType, groupId));
151+
setData(currentLink || DEFAULT_LINK_PROPS(linkType, groupId, !isDatarooms));
151152
}, [currentLink]);
152153

153154
const handlePreviewLink = async (link: LinkWithViews) => {

lib/middleware/domain.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export default async function DomainMiddleware(req: NextRequest) {
88

99
// If it's the root path, redirect to papermark.com/home
1010
if (path === "/") {
11+
if (host === "guide.permithealth.com") {
12+
return NextResponse.redirect(
13+
new URL("https://guide.permithealth.com/faq", req.url),
14+
);
15+
}
16+
1117
return NextResponse.redirect(
1218
new URL("https://www.papermark.com/home", req.url),
1319
);

0 commit comments

Comments
 (0)