Spaces:
Running

FlowWeb / src /features /canvas /components /PaywallModal.jsx
danylokhodus's picture
Claude Opus 5.5
feat: new landing, template system, auto-layout, Free/Plus plans; remove AI and hide habits
0dcbaee
Raw History Blame Contribute Delete
2.16 kB
import React from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { Lock } from 'lucide-react';
import { FREE_LIMITS } from '../../../config/plans';
const PaywallModal = ({ showPaywall, setShowPaywall }) => {
const { t } = useTranslation();
const navigate = useNavigate();
return (
<AnimatePresence>
{showPaywall && (
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
className="absolute inset-0 z-50 flex items-center justify-center bg-primary/20 backdrop-blur-md p-4"
>
<motion.div
initial={{ scale: 0.9 }}
animate={{ scale: 1 }}
className="bg-surface-container-lowest p-8 rough-border shadow-2xl max-w-md text-center"
>
<Lock size={48} className="mx-auto mb-4 text-primary" />
<h2 className="text-4xl font-display-lg mb-4 text-primary">
{t('plans.limit_title', 'Free plan limit')}
</h2>
<p className="text-xl mb-6 text-on-surface-variant font-medium">
{t('plans.limit_nodes_desc', { count: FREE_LIMITS.nodesPerBoard, defaultValue: `A board on the Free plan can hold up to ${FREE_LIMITS.nodesPerBoard} nodes. Plus has no limits.` })}
</p>
<div className="flex flex-col gap-3">
<button onClick={() => { setShowPaywall(false); navigate('/subscription'); }} className="w-full py-4 bg-primary text-on-primary font-bold rounded-xl shadow-lg hover:translate-y-[-2px] transition-all cursor-pointer">
{t('plans.see_plus', 'See Plus')}
</button>
<button onClick={() => setShowPaywall(false)} className="w-full py-4 font-bold text-on-surface-variant border-2 border-primary/10 rounded-xl cursor-pointer">
{t('pricing.maybe_later', 'Maybe Later')}
</button>
</div>
</motion.div>
</motion.div>
)}
</AnimatePresence>
);
};
export default PaywallModal;