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.
- package/dist/cjs/components/paywall/Paywall.js +3 -4
- package/dist/cjs/components/paywall/Paywall.js.map +1 -1
- package/dist/esm/components/paywall/Paywall.js +3 -4
- package/dist/esm/components/paywall/Paywall.js.map +1 -1
- package/dist/esm/types/components/paywall/Paywall.d.ts +2 -3
- package/dist/index.d.ts +2 -3
- package/package.json +1 -1
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
var session_hooks = require('../session/session.hooks.js');
|
|
5
5
|
|
|
6
|
-
const Paywall = ({ children,
|
|
6
|
+
const Paywall = ({ children, PaywallSubscriptionComponent, PaywallRegisterComponent, postPremium = false, postRegister = false, }) => {
|
|
7
7
|
const { user, subscription } = session_hooks.useSession();
|
|
8
|
-
|
|
9
|
-
if (!subscription && post && postTypeValue && postTypeValue === postType) {
|
|
8
|
+
if (!subscription && postPremium) {
|
|
10
9
|
return PaywallSubscriptionComponent;
|
|
11
10
|
}
|
|
12
|
-
if (!user &&
|
|
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';\
|
|
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,
|
|
4
|
+
const Paywall = ({ children, PaywallSubscriptionComponent, PaywallRegisterComponent, postPremium = false, postRegister = false, }) => {
|
|
5
5
|
const { user, subscription } = useSession();
|
|
6
|
-
|
|
7
|
-
if (!subscription && post && postTypeValue && postTypeValue === postType) {
|
|
6
|
+
if (!subscription && postPremium) {
|
|
8
7
|
return PaywallSubscriptionComponent;
|
|
9
8
|
}
|
|
10
|
-
if (!user &&
|
|
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';\
|
|
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
|
-
|
|
7
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
postType?: string;
|
|
118
|
+
postPremium?: boolean;
|
|
119
|
+
postRegister?: boolean;
|
|
121
120
|
}
|
|
122
121
|
declare const Paywall: React.FC<PaywallProps>;
|
|
123
122
|
|