Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
"use client";
import React from "react";
import type { PayWallPricing } from "../client";
import { usePayWallStore } from "../client";
import { PayWallDialog } from "./pay-wall-dialog";
/**
* Single, app-wide paywall instance.
* Open it from anywhere with `showPayWall()`.
*/
export function PayWall({ pricing }: { pricing: PayWallPricing | null }) {
const isOpen = usePayWallStore((state) => state.isOpen);
const hide = usePayWallStore((state) => state.hide);
React.useEffect(() => {
usePayWallStore.setState({ pricing });
}, [pricing]);
return (
<PayWallDialog
pricing={pricing}
isOpen={isOpen}
onOpenChange={(open) => {
if (!open) {
hide();
}
}}
/>
);
}