MCPcopy
hub / github.com/tone-row/flowchart-fun / showPaywall

Function showPaywall

app/src/lib/usePaywallModalStore.ts:32–65  ·  view source on GitHub ↗
({
  title,
  content,
  movieUrl,
  imgUrl = paywallImageUrl,
  toPricingCode,
  buttonText,
}: Omit<PaywallModalStore, "open">)

Source from the content-addressed store, hash-verified

30 * Also pre-load the paywall image
31 * */
32export function showPaywall({
33 title,
34 content,
35 movieUrl,
36 imgUrl = paywallImageUrl,
37 toPricingCode,
38 buttonText,
39}: Omit<PaywallModalStore, "open">) {
40 if (!buttonText) {
41 buttonText = t`Learn More`;
42 }
43
44 // If there is no movie URL, we will preload the image
45 if (!movieUrl) {
46 // Pre-load the paywall image
47 const img = new Image();
48 img.onload = open;
49 img.src = imgUrl;
50 } else {
51 open();
52 }
53
54 function open() {
55 usePaywallModalStore.setState({
56 open: true,
57 title,
58 content,
59 movieUrl,
60 imgUrl,
61 toPricingCode,
62 buttonText, // Include buttonText in setState
63 });
64 }
65}

Callers 7

handleSvgActionFunction · 0.90
CannotSaveButtonFunction · 0.90
ConvertToFlowchartFunction · 0.90
EditWithAIFunction · 0.90
LoadFileButtonFunction · 0.90
New2Function · 0.90
useRunAiWithStoreFunction · 0.90

Calls 1

openFunction · 0.85

Tested by

no test coverage detected