Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat: Basic upgrade modal (#482)

Richie McIlroyc6c8fa6db502
diff --git a/apps/web/app/dashboard/_components/DashboardInner.tsx b/apps/web/app/dashboard/_components/DashboardInner.tsx
index 13e9b1fd4..e53221fcf 100644
--- a/apps/web/app/dashboard/_components/DashboardInner.tsx
+++ b/apps/web/app/dashboard/_components/DashboardInner.tsx
@@ -8,7 +8,7 @@ import {
PopoverContent,
PopoverTrigger,
} from "@cap/ui";
-import { MoreVertical } from "lucide-react";
+import { MoreVertical, Sparkles } from "lucide-react";
import { useState } from "react";
import { useSharedContext } from "@/app/dashboard/_components/DynamicSharedLayout";
@@ -18,12 +18,14 @@ import {
faHome,
faMessage,
faSignOut,
+ faCrown,
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import clsx from "clsx";
import { signOut } from "next-auth/react";
import Link from "next/link";
import { usePathname } from "next/navigation";
+import { UpgradeModal } from "@/components/UpgradeModal";
export default function DashboardInner({
children,
@@ -63,86 +65,112 @@ export default function DashboardInner({
const User = () => {
const [menuOpen, setMenuOpen] = useState(false);
- const { user } = useSharedContext();
+ const [upgradeModalOpen, setUpgradeModalOpen] = useState(false);
+ const { user, isSubscribed } = useSharedContext();
return (
- <Popover open={menuOpen} onOpenChange={setMenuOpen}>
- <PopoverTrigger asChild>
- <div className="flex gap-2 justify-between items-center p-2 rounded-lg transition-colors cursor-pointer lg:gap-6 hover:bg-gray-100">
- <div className="flex items-center">
- <Avatar
- letterClass="text-xs lg:text-md"
- name={user.name ?? "User"}
- className="size-[24px]"
- />
- <span className="ml-2 text-sm lg:ml-3 lg:text-md">
- {user.name ?? "User"}
- </span>
+ <>
+ <UpgradeModal
+ open={upgradeModalOpen}
+ onOpenChange={setUpgradeModalOpen}
+ />
+ <Popover open={menuOpen} onOpenChange={setMenuOpen}>
+ <PopoverTrigger asChild>
+ <div className="flex gap-2 justify-between items-center p-2 rounded-lg transition-colors cursor-pointer lg:gap-6 hover:bg-gray-100">
+ <div className="flex items-center">
+ <Avatar
+ letterClass="text-xs lg:text-md"
+ name={user.name ?? "User"}
+ className="size-[24px]"
+ />
+ <span className="ml-2 text-sm lg:ml-3 lg:text-md">
+ {user.name ?? "User"}
+ </span>
+ </div>
+ <MoreVertical className="w-5 h-5 text-gray-400 group-hover:text-gray-500" />
</div>
- <MoreVertical className="w-5 h-5 text-gray-400 group-hover:text-gray-500" />
- </div>
- </PopoverTrigger>
- <PopoverContent className="p-1 w-48 bg-gray-50">
- <Command>
- <CommandGroup>
- <Link href="/home">
+ </PopoverTrigger>
+ <PopoverContent className="p-1 w-48 bg-gray-50">
+ <Command>
+ <CommandGroup>
+ <Link href="/home">
+ <CommandItem
+ className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
+ onSelect={() => {
+ setMenuOpen(false);
+ }}
+ >
+ <FontAwesomeIcon
+ icon={faHome}
+ className="mr-2 text-gray-400 transition-colors duration-300 size-3.5 group-hover:text-gray-500"
+ />
+ <span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
+ Homepage
+ </span>
+ </CommandItem>
+ </Link>
+ {!isSubscribed && (
+ <CommandItem
+ className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
+ onSelect={() => {
+ setMenuOpen(false);
+ setUpgradeModalOpen(true);
+ }}
+ >
+ <FontAwesomeIcon
+ icon={faCrown}
+ className="mr-2 text-amber-400 transition-colors duration-300 size-3.5 group-hover:text-amber-500"
+ />
+ <span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
+ Upgrade to Pro
+ </span>
+ </CommandItem>
+ )}
+ <Link href="/dashboard/settings/account">
+ <CommandItem
+ className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
+ onSelect={() => {
+ setMenuOpen(false);
+ }}
+ >
+ <FontAwesomeIcon
+ icon={faGear}
+ className="mr-2 text-gray-400 transition-colors duration-300 size-3.5 group-hover:text-gray-500"
+ />
+ <span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
+ Settings
+ </span>
+ </CommandItem>
+ </Link>
<CommandItem
className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
- onSelect={() => {
- setMenuOpen(false);
- }}
+ onSelect={() =>
+ window.open("https://cap.link/discord", "_blank")
+ }
>
<FontAwesomeIcon
- icon={faHome}
- className="mr-2 text-gray-400 transition-colors duration-300 size-3.5 group-hover:text-gray-500"
+ icon={faMessage}
+ className="mr-2 text-gray-400 transition-colors duration-300 size-3 group-hover:text-gray-500"
/>
<span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
- Homepage
+ Chat Support
</span>
</CommandItem>
- </Link>
- <Link href="/dashboard/settings/account">
<CommandItem
className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
- onSelect={() => {
- setMenuOpen(false);
- }}
+ onSelect={() => signOut()}
>
<FontAwesomeIcon
- icon={faGear}
+ icon={faSignOut}
className="mr-2 text-gray-400 transition-colors duration-300 size-3.5 group-hover:text-gray-500"
/>
<span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
- Settings
+ Sign Out
</span>
</CommandItem>
- </Link>
- <CommandItem
- className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
- onSelect={() => window.open("https://cap.link/discord", "_blank")}
- >
- <FontAwesomeIcon
- icon={faMessage}
- className="mr-2 text-gray-400 transition-colors duration-300 size-3 group-hover:text-gray-500"
- />
- <span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
- Chat Support
- </span>
- </CommandItem>
- <CommandItem
- className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
- onSelect={() => signOut()}
- >
- <FontAwesomeIcon
- icon={faSignOut}
- className="mr-2 text-gray-400 transition-colors duration-300 size-3.5 group-hover:text-gray-500"
- />
- <span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
- Sign Out
- </span>
- </CommandItem>
- </CommandGroup>
- </Command>
- </PopoverContent>
- </Popover>
+ </CommandGroup>
+ </Command>
+ </PopoverContent>
+ </Popover>
+ </>
);
};
diff --git a/apps/web/app/dashboard/settings/workspace/components/CustomDomain.tsx b/apps/web/app/dashboard/settings/workspace/components/CustomDomain.tsx
index 495e7db30..ac49f0cfc 100644
--- a/apps/web/app/dashboard/settings/workspace/components/CustomDomain.tsx
+++ b/apps/web/app/dashboard/settings/workspace/components/CustomDomain.tsx
@@ -13,6 +13,7 @@ import { Check, CheckCircle, Copy, XCircle } from "lucide-react";
import { useRouter } from "next/navigation";
import { useEffect, useRef, useState } from "react";
import { toast } from "react-hot-toast";
+import { UpgradeModal } from "@/components/UpgradeModal";
type DomainVerification = {
type: string;
@@ -53,9 +54,10 @@ export function CustomDomain() {
);
const [domainConfig, setDomainConfig] = useState<DomainConfig | null>(null);
const [copiedField, setCopiedField] = useState<"name" | "value" | null>(null);
+ const [showUpgradeModal, setShowUpgradeModal] = useState(false);
const initialCheckDone = useRef(false);
const pollInterval = useRef<NodeJS.Timeout>();
- const POLL_INTERVAL = 5000; // 5 seconds
+ const POLL_INTERVAL = 5000;
const cleanDomain = (input: string) => {
if (!input) return "";
@@ -71,7 +73,6 @@ export function CustomDomain() {
const withoutHash = withoutQuery.split("#")[0] || "";
const cleanedDomain = withoutHash.trim();
- // Check for valid domain with optional subdomains
const hasTLD =
/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/.test(
cleanedDomain
@@ -103,7 +104,7 @@ export function CustomDomain() {
if (showToasts) {
if (data.verified) {
toast.success("Domain is verified!");
- // Stop polling once verified
+
if (pollInterval.current) {
clearInterval(pollInterval.current);
pollInterval.current = undefined;
@@ -124,23 +125,18 @@ export function CustomDomain() {
};
useEffect(() => {
- // Start polling if we have a custom domain and it's not verified
if (activeSpace?.space.customDomain && !isVerified) {
- // Clear any existing interval
if (pollInterval.current) {
clearInterval(pollInterval.current);
}
- // Check immediately
checkVerification(false);
- // Start polling
pollInterval.current = setInterval(() => {
checkVerification(false);
}, POLL_INTERVAL);
}
- // Cleanup interval if domain becomes verified or component unmounts
return () => {
if (pollInterval.current) {
clearInterval(pollInterval.current);
@@ -149,7 +145,6 @@ export function CustomDomain() {
};
}, [activeSpace?.space.customDomain, isVerified]);
- // Initial check when component mounts
useEffect(() => {
if (!initialCheckDone.current && activeSpace?.space.customDomain) {
initialCheckDone.current = true;
@@ -161,28 +156,7 @@ export function CustomDomain() {
e.preventDefault();
if (!isSubscribed) {
- toast.error(
- (t) => (
- <span>
- Please upgrade to{" "}
- <a
- href="/pricing"
- className="font-medium text-blue-500 hover:text-blue-600"
- onClick={(e) => {
- e.preventDefault();
- toast.dismiss(t.id);
- router.push("/pricing");
- }}
- >
- Cap Pro
- </a>{" "}
- to use custom domains
- </span>
- ),
- {
- duration: 5000,
- }
- );
+ setShowUpgradeModal(true);
return;
}
@@ -193,7 +167,7 @@ export function CustomDomain() {
}
setLoading(true);
- setDomain(cleanedDomain); // Update the input to show the cleaned domain
+ setDomain(cleanedDomain);
try {
const data = await updateDomain(
@@ -204,16 +178,13 @@ export function CustomDomain() {
toast.success("Domain settings updated");
router.refresh();
- // Set initial domain config from the response
setDomainConfig(data.status);
setIsVerified(data.verified);
- // Trigger a refresh after 1 second to get DNS config
setTimeout(() => {
checkVerification(false);
}, 1000);
- // Start polling
pollInterval.current = setInterval(() => {
checkVerification(false);
}, POLL_INTERVAL);
@@ -226,28 +197,7 @@ export function CustomDomain() {
const handleRemoveDomain = async () => {
if (!isSubscribed) {
- toast.error(
- (t) => (
- <span>
- Please upgrade to{" "}
- <a
- href="/pricing"
- className="font-medium text-blue-500 hover:text-blue-600"
- onClick={(e) => {
- e.preventDefault();
- toast.dismiss(t.id);
- router.push("/pricing");
- }}
- >
- Cap Pro
- </a>{" "}
- to use custom domains
- </span>
- ),
- {
- duration: 5000,
- }
- );
+ setShowUpgradeModal(true);
return;
}
@@ -257,7 +207,6 @@ export function CustomDomain() {
try {
await removeWorkspaceDomain(activeSpace?.space.id as string);
- // Clear polling when domain is removed
if (pollInterval.current) {
clearInterval(pollInterval.current);
pollInterval.current = undefined;
@@ -534,6 +483,12 @@ export function CustomDomain() {
</div>
)}
</div>
+ {showUpgradeModal && (
+ <UpgradeModal
+ open={showUpgradeModal}
+ onOpenChange={setShowUpgradeModal}
+ />
+ )}
</div>
);
}
diff --git a/apps/web/components/UpgradeModal.tsx b/apps/web/components/UpgradeModal.tsx
new file mode 100644
index 000000000..fb7c28fb2
--- /dev/null
+++ b/apps/web/components/UpgradeModal.tsx
@@ -0,0 +1,283 @@
+"use client";
+
+import { useState } from "react";
+import { Button, Dialog, DialogContent, DialogTitle, Switch } from "@cap/ui";
+import {
+ Share2,
+ Database,
+ Shield,
+ Users,
+ Infinity,
+ Lock,
+ BarChart3,
+ Headphones,
+ X,
+ Minus,
+ Plus,
+ Globe,
+ Sparkles,
+} from "lucide-react";
+import { getProPlanId } from "@cap/utils";
+import { useRouter } from "next/navigation";
+import toast from "react-hot-toast";
+import { useRive } from "@rive-app/react-canvas";
+import { AnimatePresence, motion } from "framer-motion";
+
+interface UpgradeModalProps {
+ open: boolean;
+ onOpenChange: (open: boolean) => void;
+}
+
+const modalVariants = {
+ hidden: {
+ opacity: 0,
+ scale: 0.95,
+ y: 10,
+ },
+ visible: {
+ opacity: 1,
+ scale: 1,
+ y: 0,
+ transition: {
+ type: "spring",
+ duration: 0.4,
+ damping: 25,
+ stiffness: 500,
+ },
+ },
+ exit: {
+ opacity: 0,
+ scale: 0.95,
+ y: 10,
+ transition: {
+ duration: 0.2,
+ },
+ },
+};
+
+export const UpgradeModal = ({ open, onOpenChange }: UpgradeModalProps) => {
+ const [proLoading, setProLoading] = useState(false);
+ const [isAnnual, setIsAnnual] = useState(true);
+ const [proQuantity, setProQuantity] = useState(1);
+ const { push } = useRouter();
+
+ const pricePerUser = isAnnual ? 6 : 9;
+ const totalPrice = pricePerUser * proQuantity;
+ const billingText = isAnnual ? "billed annually" : "billed monthly";
+
+ const { RiveComponent: Pro, rive: riveInstance } = useRive({
+ src: "/rive/pricing.riv",
+ artboard: "pro",
+ animations: ["items-coming-out"],
+ autoplay: true,
+ });
+
+ const handleProHover = () => {
+ if (riveInstance) {
+ riveInstance.play(["items-coming-out"]);
+ }
+ };
+
+ const proFeatures = [
+ {
+ icon: <Globe className="w-8 h-8 text-blue-500" />,
+ title: "Custom domain",
+ description: "Connect your own domain to Cap",
+ },
+ {
+ icon: <Share2 className="w-8 h-8 text-blue-500" />,
+ title: "Unlimited sharing",
+ description: "Cloud storage & shareable links",
+ },
+ {
+ icon: <Database className="w-8 h-8 text-blue-500" />,
+ title: "Custom storage",
+ description: "Connect your own S3 bucket",
+ },
+ {
+ icon: <Shield className="w-8 h-8 text-blue-500" />,
+ title: "Commercial license",
+ description: "Commercial license for desktop app automatically included",
+ },
+ {
+ icon: <Users className="w-8 h-8 text-blue-500" />,
+ title: "Team features",
+ description: "Collaborate with your team and create shared spaces",
+ },
+ {
+ icon: <Sparkles className="w-8 h-8 text-blue-500" />,
+ title: "Cap AI (Coming Soon)",
+ description: "Automatic video chapters, summaries & more",
+ },
+ {
+ icon: <Infinity className="w-8 h-8 text-blue-500" />,
+ title: "Unlimited views",
+ description: "No limits on video views",
+ },
+ {
+ icon: <Lock className="w-8 h-8 text-blue-500" />,
+ title: "Password protected videos",
+ description: "Enhanced security for your content",
+ },
+ {
+ icon: <BarChart3 className="w-8 h-8 text-blue-500" />,
+ title: "Analytics",
+ description: "Video viewing insights",
+ },
+ {
+ icon: <Headphones className="w-8 h-8 text-blue-500" />,
+ title: "Priority support",
+ description: "Get help when you need it",
+ },
+ ];
+
+ const planCheckout = async () => {
+ setProLoading(true);
+
+ const planId = getProPlanId(isAnnual ? "yearly" : "monthly");
+
+ const response = await fetch(`/api/settings/billing/subscribe`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({ priceId: planId, quantity: proQuantity }),
+ });
+ const data = await response.json();
+
+ if (data.auth === false) {
+ localStorage.setItem("pendingPriceId", planId);
+ localStorage.setItem("pendingQuantity", proQuantity.toString());
+ push(`/login?next=/dashboard`);
+ return;
+ }
+
+ if (data.subscription === true) {
+ toast.success("You are already on the Cap Pro plan");
+ onOpenChange(false);
+ }
+
+ if (data.url) {
+ window.location.href = data.url;
+ }
+
+ setProLoading(false);
+ };
+
+ return (
+ <Dialog open={open} onOpenChange={onOpenChange}>
+ <DialogContent className="sm:max-w-[650px] max-h-[90vh] overflow-y-auto p-6">
+ <AnimatePresence mode="wait">
+ {open && (
+ <motion.div
+ className="relative"
+ variants={modalVariants}
+ initial="hidden"
+ animate="visible"
+ exit="exit"
+ >
+ <div className="sr-only">
+ <DialogTitle>Upgrade to Cap Pro</DialogTitle>
+ </div>
+
+ <div className="flex flex-col items-center py-6">
+ <div className="flex flex-col items-center">
+ <Pro
+ className="w-[100px] h-[80px]"
+ onMouseEnter={handleProHover}
+ />
+ <h1 className="text-3xl font-bold mb-3">
+ Upgrade to Cap Pro
+ </h1>
+ </div>
+
+ <p className="text-lg text-gray-600 mb-1">
+ You can cancel anytime. Early adopter pricing locked in.
+ </p>
+
+ <div className="flex flex-col items-center mt-3 mb-4 w-full">
+ <div className="flex items-end mb-1">
+ <h3 className="text-3xl font-bold">${totalPrice}/mo</h3>
+ <span className="text-gray-500 ml-2 mb-1">
+ {proQuantity === 1 ? (
+ `per user, ${billingText}`
+ ) : (
+ <>
+ for <strong>{proQuantity}</strong> users,{" "}
+ {billingText}
+ </>
+ )}
+ </span>
+ </div>
+
+ <div className="flex justify-between items-center w-full max-w-md mt-4">
+ <div className="flex items-center">
+ <span className="mr-3 text-gray-500">Annual billing</span>
+ <Switch
+ checked={isAnnual}
+ onCheckedChange={() => setIsAnnual(!isAnnual)}
+ />
+ </div>
+
+ <div className="flex items-center">
+ <span className="mr-3 text-gray-500">Users:</span>
+ <div className="flex items-center">
+ <button
+ onClick={() =>
+ proQuantity > 1 && setProQuantity(proQuantity - 1)
+ }
+ className="h-8 w-8 rounded-l-md bg-gray-100 flex items-center justify-center hover:bg-gray-200"
+ disabled={proQuantity <= 1}
+ >
+ <Minus className="h-4 w-4" />
+ </button>
+ <div className="h-8 w-10 flex items-center justify-center bg-gray-100">
+ {proQuantity}
+ </div>
+ <button
+ onClick={() => setProQuantity(proQuantity + 1)}
+ className="h-8 w-8 rounded-r-md bg-gray-100 flex items-center justify-center hover:bg-gray-200"
+ >
+ <Plus className="h-4 w-4" />
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <Button
+ variant="primary"
+ onClick={planCheckout}
+ className="w-full max-w-md text-lg h-14 rounded-xl"
+ disabled={proLoading}
+ >
+ {proLoading ? "Loading..." : "Upgrade to Cap Pro"}
+ </Button>
+ </div>
+
+ <div className="pt-8 mt-4 border-t border-gray-200">
+ <h2 className="text-2xl font-bold text-center mb-10">
+ Here's what's included
+ </h2>
+
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-x-10 gap-y-12">
+ {proFeatures.map((feature, index) => (
+ <div key={index} className="flex flex-col items-center">
+ <div className="mb-3">{feature.icon}</div>
+ <h3 className="text-lg font-bold mb-1">
+ {feature.title}
+ </h3>
+ <p className="text-gray-600 text-center">
+ {feature.description}
+ </p>
+ </div>
+ ))}
+ </div>
+ </div>
+ </motion.div>
+ )}
+ </AnimatePresence>
+ </DialogContent>
+ </Dialog>
+ );
+};
diff --git a/apps/web/components/UsageButton.tsx b/apps/web/components/UsageButton.tsx
index 2cfdd460f..abfcf0287 100644
--- a/apps/web/components/UsageButton.tsx
+++ b/apps/web/components/UsageButton.tsx
@@ -4,6 +4,8 @@ import { faArrowUp, faCheck } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import clsx from "clsx";
import Link from "next/link";
+import { useState } from "react";
+import { UpgradeModal } from "./UpgradeModal";
export const UsageButton = ({
subscribed,
@@ -12,42 +14,89 @@ export const UsageButton = ({
subscribed: boolean;
collapsed: boolean;
}) => {
- return (
- <Tooltip position="right" content={subscribed ? "Cap Pro" : "Upgrade to Pro"}>
- <Link
- className="flex justify-center mx-auto w-full"
- href={subscribed ? "/dashboard/settings/workspace" : "/pricing"}
- >
- <Button
- size="lg"
- className={clsx(
- "overflow-hidden truncate",
- collapsed ? "p-0 w-10 h-10 rounded-full min-w-10" : "w-full"
- )}
- variant="primary"
+ const [upgradeModalOpen, setUpgradeModalOpen] = useState(false);
+
+ if (subscribed) {
+ return (
+ <Tooltip position="right" content="Cap Pro">
+ <Link
+ className="flex justify-center mx-auto w-full"
+ href="/dashboard/settings/workspace"
>
- <img
- src="/illustrations/cloud-1.png"
- className="absolute w-32 opacity-30 left-[-32px]"
- />
- <img
- src="/illustrations/cloud-2.png"
- className="absolute w-32 opacity-30 right-[-82px]"
- />
- <FontAwesomeIcon
+ <Button
+ size="lg"
+ className={clsx(
+ "overflow-hidden truncate",
+ collapsed ? "p-0 w-10 h-10 rounded-full min-w-10" : "w-full"
+ )}
+ variant="primary"
+ >
+ <img
+ src="/illustrations/cloud-1.png"
+ className="absolute w-32 opacity-30 left-[-32px]"
+ />
+ <img
+ src="/illustrations/cloud-2.png"
+ className="absolute w-32 opacity-30 right-[-82px]"
+ />
+ <FontAwesomeIcon
+ className={clsx(
+ "text-gray-50 drop-shadow-[0_0_2px_rgba(255,255,255,0.5)]",
+ collapsed ? "mr-0" : "mr-1"
+ )}
+ icon={faCheck}
+ />
+ {collapsed ? null : (
+ <p className="text-gray-50 drop-shadow-[0_0_2px_rgba(255,255,255,0.5)]">
+ Cap Pro
+ </p>
+ )}
+ </Button>
+ </Link>
+ </Tooltip>
+ );
+ }
+
+ return (
+ <>
+ <Tooltip position="right" content="Upgrade to Pro">
+ <div className="flex justify-center mx-auto w-full">
+ <Button
+ size="lg"
className={clsx(
- "text-gray-50 drop-shadow-[0_0_2px_rgba(255,255,255,0.5)]",
- collapsed ? "mr-0" : "mr-1"
+ "overflow-hidden truncate",
+ collapsed ? "p-0 w-10 h-10 rounded-full min-w-10" : "w-full"
+ )}
+ variant="primary"
+ onClick={() => setUpgradeModalOpen(true)}
+ >
+ <img
+ src="/illustrations/cloud-1.png"
+ className="absolute w-32 opacity-30 left-[-32px]"
+ />
+ <img
+ src="/illustrations/cloud-2.png"
+ className="absolute w-32 opacity-30 right-[-82px]"
+ />
+ <FontAwesomeIcon
+ className={clsx(
+ "text-gray-50 drop-shadow-[0_0_2px_rgba(255,255,255,0.5)]",
+ collapsed ? "mr-0" : "mr-1"
+ )}
+ icon={faArrowUp}
+ />
+ {collapsed ? null : (
+ <p className="text-gray-50 drop-shadow-[0_0_2px_rgba(255,255,255,0.5)]">
+ Upgrade to Pro
+ </p>
)}
- icon={subscribed ? faCheck : faArrowUp}
- />
- {collapsed ? null : (
- <p className="text-gray-50 drop-shadow-[0_0_2px_rgba(255,255,255,0.5)]">
- {subscribed ? "Cap Pro" : "Upgrade to Pro"}
- </p>
- )}
- </Button>
- </Link>
- </Tooltip>
+ </Button>
+ </div>
+ </Tooltip>
+ <UpgradeModal
+ open={upgradeModalOpen}
+ onOpenChange={setUpgradeModalOpen}
+ />
+ </>
);
};
diff --git a/apps/web/public/rive/pricing.riv b/apps/web/public/rive/pricing.riv
new file mode 100644
index 000000000..78c4c6f46
Binary files /dev/null and b/apps/web/public/rive/pricing.riv differ
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 767fed6d5..64ad9af5c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5875,10 +5875,10 @@ packages:
react-dom:
optional: true
- '@storybook/[email protected]':
- resolution: {integrity: sha512-OALGrbqmpvLib/0yQl3Q1ggmTqOtMENURwwyhNe3Vb3HGQ8O+srDPPQ/xk0fSy7FO1YOoybZQHBpExOdfCpEKg==}
+ '@storybook/[email protected]':
+ resolution: {integrity: sha512-D718PrP4rbppHUE7HsosbHxTQNGRal4BazV6RCrDWnu4+UG64qur3KztjxeGZdU+Sv7UEF5BJiYEokQHH0aBNw==}
peerDependencies:
- storybook: ^9.0.0-beta.1
+ storybook: ^9.0.0-beta.4
vite: ^5.0.0 || ^6.0.0
'@storybook/[email protected]':
@@ -5889,10 +5889,10 @@ packages:
peerDependencies:
storybook: ^8.3.3
- '@storybook/[email protected]':
- resolution: {integrity: sha512-Od2EyWGiozSDy0IGBdYYo7U+x46rYTYO0Mm0wimAxtotSjIC03b91BVGFXeYxDN/Cd2ObpfKQlDnque8HrrBXw==}
+ '@storybook/[email protected]':
+ resolution: {integrity: sha512-eHyYQBWW5kwn8HtaDooIeT0nuhQysafyHL5QfPlyErAzDn1oVR+0EDWPlEgXy0pzqVzY3Axh3SqZ37ccA7kIeA==}
peerDependencies:
- storybook: ^9.0.0-beta.1
+ storybook: ^9.0.0-beta.4
'@storybook/[email protected]':
resolution: {integrity: sha512-dHYFQH3mA+EtnCkHXzicbLgsvzYjcDJ1JWsogbItZogkPHgSJM/Wr71uMkcvw8v9mmCyP4NpXJuu6bPoVsOnzg==}
@@ -18930,9 +18930,9 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1([email protected])
dependencies:
- '@storybook/csf-plugin': 9.0.0-beta.1([email protected])
+ '@storybook/csf-plugin': 9.0.0-beta.4([email protected])
browser-assert: 1.2.1
storybook: 8.3.3
ts-dedent: 2.2.0
@@ -18963,7 +18963,7 @@ snapshots:
storybook: 8.3.3
unplugin: 1.16.1
dependencies:
storybook: 8.3.3
unplugin: 1.16.1
@@ -27382,7 +27382,7 @@ snapshots:
dependencies:
transitivePeerDependencies:
- storybook
- vite