Skip to content

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

Improvement: Redesign banner for trial

Ashish Viradiya2ed7cc2ad35a
diff --git a/components/layouts/trial-banner.tsx b/components/layouts/trial-banner.tsx
index 11382aed..a33c3472 100644
--- a/components/layouts/trial-banner.tsx
+++ b/components/layouts/trial-banner.tsx
@@ -3,6 +3,7 @@ import { Dispatch, SetStateAction, useEffect, useState } from "react";
import { useTeam } from "@/context/team-context";
import { PlanEnum } from "@/ee/stripe/constants";
import Cookies from "js-cookie";
+import { CrownIcon } from "lucide-react";
import { usePlausible } from "next-plausible";
import { usePlan } from "@/lib/swr/use-billing";
@@ -10,7 +11,12 @@ import useDatarooms from "@/lib/swr/use-datarooms";
import { daysLeft } from "@/lib/utils";
import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";
-import X from "@/components/shared/icons/x";
+import {
+ Alert,
+ AlertClose,
+ AlertDescription,
+ AlertTitle,
+} from "@/components/ui/alert";
export default function TrialBanner() {
const { trial } = usePlan();
@@ -51,50 +57,41 @@ function TrialBannerComponent({
const { datarooms } = useDatarooms();
return (
- <div className="mx-2 my-2 mb-2 rounded-xl border border-gray-900 bg-white p-1 dark:border-gray-600 dark:bg-gray-900">
- <nav className="relative flex flex-col bg-white px-4 py-3 dark:bg-gray-900">
- <button
- type="button"
- onClick={handleHideBanner}
- className="absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none"
- >
- <X className="h-4 w-4" />
- <span className="sr-only">Close</span>
- </button>
- <div className="flex flex-col space-y-2">
- <div className="text-sm font-bold">
- Data Room trial:{" "}
- {datarooms &&
- daysLeft(
- new Date(
- datarooms[0]?.createdAt ??
- teamInfo?.currentTeam?.createdAt ??
- new Date(),
- ),
- 7,
- )}{" "}
- days left
- </div>
-
- <div className="text-sm">
- You are on the <span className="font-bold">Data Rooms</span> plan
- trial, you have access to advanced access controls, group
- permissions, and data room.{" "}
- <UpgradePlanModal
- clickedPlan={PlanEnum.DataRooms}
- trigger={"trial_navbar"}
+ <div className="mx-2 my-2 mb-2">
+ <Alert variant="default">
+ <CrownIcon className="h-4 w-4" />
+ <AlertTitle>
+ Data Room trial:{" "}
+ {datarooms &&
+ daysLeft(
+ new Date(
+ datarooms[0]?.createdAt ??
+ teamInfo?.currentTeam?.createdAt ??
+ new Date(),
+ ),
+ 7,
+ )}{" "}
+ days left
+ </AlertTitle>
+ <AlertDescription>
+ You are on the <span className="font-bold">Data Rooms</span> plan
+ trial, you have access to advanced access controls, group permissions,
+ and data room. <br />
+ <UpgradePlanModal
+ clickedPlan={PlanEnum.DataRooms}
+ trigger={"trial_navbar"}
+ >
+ <span
+ className="cursor-pointer font-bold text-orange-500 underline underline-offset-4 hover:text-orange-600"
+ onClick={() => plausible("clickedUpgradeTrialNavbar")}
>
- <span
- className="cursor-pointer font-bold text-orange-500"
- onClick={() => plausible("clickedUpgradeTrialNavbar")}
- >
- Upgrade to keep access
- </span>
- </UpgradePlanModal>
- , unlock unlimited data rooms and custom domains ✨
- </div>
- </div>
- </nav>
+ Upgrade to keep access
+ </span>
+ </UpgradePlanModal>
+ , unlock unlimited data rooms and custom domains ✨
+ </AlertDescription>
+ <AlertClose onClick={handleHideBanner} />
+ </Alert>
</div>
);
-}
+}
\ No newline at end of file