Emails
1 month ago
EngagementChart
1 month ago
MediaHub
1 month ago
Onboarding
1 month ago
Popup
1 month ago
Skeletons
1 week ago
WhatsNew
1 month ago
charts
1 month ago
test
1 month ago
AdminMenuSync.js
1 month ago
ChartEmptyState.js
1 month ago
ChooseDate.js
1 month ago
ColorPicker.js
1 month ago
ExtendPlugins.js
1 month ago
Filters.js
1 month ago
Link.js
1 month ago
Navbar.js
1 week ago
NoFound.js
1 month ago
PageHeader.js
1 month ago
PluginRecommendations.js
1 month ago
PostScheduleField.js
1 month ago
PrestoPlayerIcon.js
1 month ago
ProGateOverlay.js
1 month ago
QuickAccess.js
1 month ago
RankedTable.js
1 month ago
StatCard.js
1 month ago
TopMedia.js
1 month ago
TopPerformingMedia.js
1 month ago
TopUsers.js
1 month ago
TruncatedTitle.js
1 month ago
UpgradeNotice.js
1 month ago
UpgradeToPro.js
1 month ago
VideoModal.js
1 month ago
WelcomeBanner.js
1 month ago
ProGateOverlay.js
45 lines
| 1 | import { useRef, useEffect } from 'react'; |
| 2 | import UpgradeToPro from "./UpgradeToPro"; |
| 3 | |
| 4 | /** |
| 5 | * Full-page Pro gate overlay. Renders a blurred skeleton preview |
| 6 | * with a centered UpgradeToPro card. Used on Pro-only pages |
| 7 | * (Analytics, Emails) to show a frosted "sneak peek" of the content. |
| 8 | * |
| 9 | * @param {Object} props |
| 10 | * @param {JSX.Element} props.children - The skeleton component to blur behind the overlay. |
| 11 | */ |
| 12 | const ProGateOverlay = ({ children }) => { |
| 13 | const inertRef = useRef(null); |
| 14 | |
| 15 | useEffect(() => { |
| 16 | if (inertRef.current) { |
| 17 | inertRef.current.setAttribute('inert', ''); |
| 18 | } |
| 19 | }, []); |
| 20 | |
| 21 | return ( |
| 22 | <div className="relative flex-1 min-h-0 overflow-hidden"> |
| 23 | <div |
| 24 | ref={inertRef} |
| 25 | aria-hidden="true" |
| 26 | className="absolute inset-0 overflow-hidden blur-[3px] pointer-events-none select-none opacity-80" |
| 27 | > |
| 28 | {children} |
| 29 | </div> |
| 30 | <div className="absolute inset-0 bg-white/30 flex items-center justify-center p-8"> |
| 31 | {/* max-w-3xl keeps the card tight so the illustration and copy sit |
| 32 | close together — wider widths leave too much whitespace between |
| 33 | the two columns. -translate-y nudges the card above the geometric |
| 34 | center so it sits in the optical center of the viewport (the page |
| 35 | chrome above pulls perceived center upward). */} |
| 36 | <div className="max-w-xl w-full drop-shadow-2xl -translate-y-[6vh]"> |
| 37 | <UpgradeToPro layout="horizontal" /> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | ); |
| 42 | }; |
| 43 | |
| 44 | export default ProGateOverlay; |
| 45 |