react-easy-wall 1.1.18 → 1.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,13 +3,12 @@
3
3
 
4
4
  var session_hooks = require('../session/session.hooks.js');
5
5
 
6
- const Paywall = ({ children, post, postTypeField, postType, PaywallSubscriptionComponent, PaywallRegisterComponent, }) => {
6
+ const Paywall = ({ children, PaywallSubscriptionComponent, PaywallRegisterComponent, postPremium = false, postRegister = false, }) => {
7
7
  const { user, subscription } = session_hooks.useSession();
8
- const postTypeValue = post[postTypeField];
9
- if (!subscription && post && postTypeValue && postTypeValue === postType) {
8
+ if (!subscription && postPremium) {
10
9
  return PaywallSubscriptionComponent;
11
10
  }
12
- if (!user && post && postTypeValue && postTypeValue === postType) {
11
+ if (!(user && postRegister)) {
13
12
  return PaywallRegisterComponent;
14
13
  }
15
14
  return children;
@@ -1 +1 @@
1
- {"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { useSession } from '../session/session.hooks';\nimport { PaywallSubscription } from './PaywallSubscription';\n\nexport interface PaywallProps {\n children?: React.ReactNode;\n PaywallSubscriptionComponent?: React.ReactNode;\n PaywallRegisterComponent?: React.ReactNode;\n post?: any;\n postTypeField?: string;\n postType?: string;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n post,\n postTypeField,\n postType,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n}) => {\n const { user, subscription } = useSession();\n const postTypeValue = post[postTypeField as string];\n if (!subscription && post && postTypeValue && postTypeValue === postType) {\n return PaywallSubscriptionComponent;\n }\n\n if (!user && post && postTypeValue && postTypeValue === postType) {\n return PaywallRegisterComponent;\n }\n\n return children;\n};\n"],"names":[],"mappings":";;;;;AAcO;;AASL;;AAEE;;;AAIA;;AAGF;AACF;;"}
1
+ {"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { useSession } from '../session/session.hooks';\n\nexport interface PaywallProps {\n children?: React.ReactNode;\n PaywallSubscriptionComponent?: React.ReactNode;\n PaywallRegisterComponent?: React.ReactNode;\n postPremium?: boolean;\n postRegister?: boolean;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n postPremium = false,\n postRegister = false,\n}) => {\n const { user, subscription } = useSession();\n\n if (!subscription && postPremium) {\n return PaywallSubscriptionComponent;\n }\n\n if (!(user && postRegister)) {\n return PaywallRegisterComponent;\n }\n\n return children;\n};\n"],"names":[],"mappings":";;;;;;;AAqBE;AACE;;AAGF;AACE;;AAGF;AACF;;"}
@@ -1,13 +1,12 @@
1
1
  "use client";
2
2
  import { useSession } from '../session/session.hooks.js';
3
3
 
4
- const Paywall = ({ children, post, postTypeField, postType, PaywallSubscriptionComponent, PaywallRegisterComponent, }) => {
4
+ const Paywall = ({ children, PaywallSubscriptionComponent, PaywallRegisterComponent, postPremium = false, postRegister = false, }) => {
5
5
  const { user, subscription } = useSession();
6
- const postTypeValue = post[postTypeField];
7
- if (!subscription && post && postTypeValue && postTypeValue === postType) {
6
+ if (!subscription && postPremium) {
8
7
  return PaywallSubscriptionComponent;
9
8
  }
10
- if (!user && post && postTypeValue && postTypeValue === postType) {
9
+ if (!(user && postRegister)) {
11
10
  return PaywallRegisterComponent;
12
11
  }
13
12
  return children;
@@ -1 +1 @@
1
- {"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { useSession } from '../session/session.hooks';\nimport { PaywallSubscription } from './PaywallSubscription';\n\nexport interface PaywallProps {\n children?: React.ReactNode;\n PaywallSubscriptionComponent?: React.ReactNode;\n PaywallRegisterComponent?: React.ReactNode;\n post?: any;\n postTypeField?: string;\n postType?: string;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n post,\n postTypeField,\n postType,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n}) => {\n const { user, subscription } = useSession();\n const postTypeValue = post[postTypeField as string];\n if (!subscription && post && postTypeValue && postTypeValue === postType) {\n return PaywallSubscriptionComponent;\n }\n\n if (!user && post && postTypeValue && postTypeValue === postType) {\n return PaywallRegisterComponent;\n }\n\n return children;\n};\n"],"names":[],"mappings":";;;AAcO;;AASL;;AAEE;;;AAIA;;AAGF;AACF;;"}
1
+ {"version":3,"file":"Paywall.js","sources":["../../../../src/components/paywall/Paywall.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { useSession } from '../session/session.hooks';\n\nexport interface PaywallProps {\n children?: React.ReactNode;\n PaywallSubscriptionComponent?: React.ReactNode;\n PaywallRegisterComponent?: React.ReactNode;\n postPremium?: boolean;\n postRegister?: boolean;\n}\n\nexport const Paywall: React.FC<PaywallProps> = ({\n children,\n PaywallSubscriptionComponent,\n PaywallRegisterComponent,\n postPremium = false,\n postRegister = false,\n}) => {\n const { user, subscription } = useSession();\n\n if (!subscription && postPremium) {\n return PaywallSubscriptionComponent;\n }\n\n if (!(user && postRegister)) {\n return PaywallRegisterComponent;\n }\n\n return children;\n};\n"],"names":[],"mappings":";;;;;AAqBE;AACE;;AAGF;AACE;;AAGF;AACF;;"}
@@ -3,8 +3,7 @@ export interface PaywallProps {
3
3
  children?: React.ReactNode;
4
4
  PaywallSubscriptionComponent?: React.ReactNode;
5
5
  PaywallRegisterComponent?: React.ReactNode;
6
- post?: any;
7
- postTypeField?: string;
8
- postType?: string;
6
+ postPremium?: boolean;
7
+ postRegister?: boolean;
9
8
  }
10
9
  export declare const Paywall: React.FC<PaywallProps>;
package/dist/index.d.ts CHANGED
@@ -115,9 +115,8 @@ interface PaywallProps {
115
115
  children?: React.ReactNode;
116
116
  PaywallSubscriptionComponent?: React.ReactNode;
117
117
  PaywallRegisterComponent?: React.ReactNode;
118
- post?: any;
119
- postTypeField?: string;
120
- postType?: string;
118
+ postPremium?: boolean;
119
+ postRegister?: boolean;
121
120
  }
122
121
  declare const Paywall: React.FC<PaywallProps>;
123
122
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-easy-wall",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/index.d.ts",