react-easy-wall 1.1.3 → 1.1.6

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.
@@ -6,7 +6,7 @@ var Box = require('../../node_modules/@mui/material/esm/Box/Box.js');
6
6
  var Typography = require('../../node_modules/@mui/material/esm/Typography/Typography.js');
7
7
  var Button = require('../../node_modules/@mui/material/esm/Button/Button.js');
8
8
 
9
- const PaywallSubscription = ({ containerProps = {}, subtitleProps = {}, buttonProps = {}, titleProps = {}, secondaryButtonText = '', secondaryButtonProps = {}, withCaption = false, title = 'Este artículo es exclusivo para suscriptores', subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.', post, buttonText = '', }) => {
9
+ const PaywallSubscription = ({ containerProps = {}, subtitleProps = {}, buttonProps = {}, titleProps = {}, secondaryButtonText = '', secondaryButtonProps = {}, withCaption = false, title = 'Este artículo es exclusivo para suscriptores', subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.', post, buttonText = 'Suscríbete', }) => {
10
10
  const { sx: sxContainerProps, ...containerPropRest } = containerProps;
11
11
  const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;
12
12
  const { sx: sxTitleProps, ...titlePropRest } = titleProps;
@@ -26,26 +26,38 @@ const PaywallSubscription = ({ containerProps = {}, subtitleProps = {}, buttonPr
26
26
  }
27
27
  return (window.location.href = `${paywall_constants.PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);
28
28
  };
29
- return (jsxRuntime.jsxs(Box.default, { sx: {
29
+ return (jsxRuntime.jsx(Box.default, { sx: {
30
30
  height: withCaption ? 220 : 300,
31
31
  width: '100%',
32
32
  border: '1px solid #707070',
33
33
  justifyContent: 'center',
34
34
  alignItems: 'center',
35
35
  flexDirection: 'column',
36
+ background: 'white',
37
+ paddingTop: 80,
38
+ paddingBottom: 80,
36
39
  ...sxContainerProps,
37
- }, ...containerPropRest, children: [jsxRuntime.jsx(Typography.default, { sx: { ...sxTitleProps }, ...titlePropRest, children: title }), jsxRuntime.jsx(Typography.default, { sx: { ...sxSubtitleProps }, ...subtitlePropRest, children: subtitle }), jsxRuntime.jsx(Button.default, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
38
- background: '#f75957',
39
- '&:hover': {
40
- backgroundColor: '#f75957',
41
- },
42
- ...sxButtonProps,
43
- }, onClick: () => handleButton(), ...buttonPropsRest, children: buttonText }), jsxRuntime.jsx(Button.default, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
44
- textDecoration: 'underline',
45
- background: 'transparent',
46
- padding: '0.5rem 1rem',
47
- ...sxSecondaryButtonProps,
48
- }, onClick: () => handleSecondaryButton(), ...secondaryButtonPropsRest, children: secondaryButtonText })] }));
40
+ }, ...containerPropRest, children: jsxRuntime.jsxs(Box.default, { sx: {
41
+ width: {
42
+ xs: 360,
43
+ md: 460,
44
+ },
45
+ justifyContent: 'center',
46
+ alignItems: 'center',
47
+ flexDirection: 'column',
48
+ }, children: [jsxRuntime.jsx(Typography.default, { sx: { fontWeight: 500, ...sxTitleProps }, ...titlePropRest, children: title }), jsxRuntime.jsx(Typography.default, { sx: { ...sxSubtitleProps }, ...subtitlePropRest, children: subtitle }), jsxRuntime.jsx(Button.default, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
49
+ background: '#f75957',
50
+ '&:hover': {
51
+ backgroundColor: '#f75957',
52
+ },
53
+ ...sxButtonProps,
54
+ }, onClick: () => handleButton(), ...buttonPropsRest, children: buttonText }), jsxRuntime.jsx(Button.default, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
55
+ textDecoration: 'underline',
56
+ background: 'transparent',
57
+ padding: '0.5rem 1rem',
58
+ fontWeight: 500,
59
+ ...sxSecondaryButtonProps,
60
+ }, onClick: () => handleSecondaryButton(), ...secondaryButtonPropsRest, children: secondaryButtonText })] }) }));
49
61
  };
50
62
 
51
63
  exports.PaywallSubscription = PaywallSubscription;
@@ -1 +1 @@
1
- {"version":3,"file":"PaywallSubscription.js","sources":["../../../../src/components/paywall/PaywallSubscription.tsx"],"sourcesContent":["import React from 'react';\nimport { Box, BoxProps, Typography, TypographyProps, ButtonProps, Button } from '@mui/material';\nimport { PAYWALL_AUTH_ENDPOINT } from './paywall.constants';\n\nexport interface PaywallSubscriptionProps {\n post?: any;\n containerProps?: BoxProps;\n titleProps?: TypographyProps;\n subtitleProps?: TypographyProps;\n buttonProps?: ButtonProps;\n buttonText?: string;\n secondaryButtonProps?: ButtonProps;\n secondaryButtonText?: string;\n title?: string;\n subtitle?: string;\n withCaption?: boolean;\n}\n\nexport const PaywallSubscription: React.FC<PaywallSubscriptionProps> = ({\n containerProps = {},\n subtitleProps = {},\n buttonProps = {},\n titleProps = {},\n secondaryButtonText = '',\n secondaryButtonProps = {},\n withCaption = false,\n title = 'Este artículo es exclusivo para suscriptores',\n subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.',\n post,\n buttonText = '',\n}) => {\n const { sx: sxContainerProps, ...containerPropRest } = containerProps;\n const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;\n const { sx: sxTitleProps, ...titlePropRest } = titleProps;\n const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;\n const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;\n\n const handleButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/planes?post_url=${window.location.href}`);\n };\n\n const handleSecondaryButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);\n };\n\n return (\n <Box\n sx={{\n height: withCaption ? 220 : 300,\n width: '100%',\n border: '1px solid #707070',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n ...sxContainerProps,\n }}\n {...containerPropRest}>\n <Typography sx={{ ...sxTitleProps }} {...titlePropRest}>\n {title}\n </Typography>\n <Typography sx={{ ...sxSubtitleProps }} {...subtitlePropRest}>\n {subtitle}\n </Typography>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n background: '#f75957',\n '&:hover': {\n backgroundColor: '#f75957',\n },\n ...sxButtonProps,\n }}\n onClick={() => handleButton()}\n {...buttonPropsRest}>\n {buttonText}\n </Button>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n textDecoration: 'underline',\n background: 'transparent',\n padding: '0.5rem 1rem',\n ...sxSecondaryButtonProps,\n }}\n onClick={() => handleSecondaryButton()}\n {...secondaryButtonPropsRest}>\n {secondaryButtonText}\n </Button>\n </Box>\n );\n};\n"],"names":["PAYWALL_AUTH_ENDPOINT","_jsxs","Box","_jsx","Typography","Button"],"mappings":";;;;;;;;MAkBa,mBAAmB,GAAuC,CAAC,EACtE,cAAc,GAAG,EAAE,EACnB,aAAa,GAAG,EAAE,EAClB,WAAW,GAAG,EAAE,EAChB,UAAU,GAAG,EAAE,EACf,mBAAmB,GAAG,EAAE,EACxB,oBAAoB,GAAG,EAAE,EACzB,WAAW,GAAG,KAAK,EACnB,KAAK,GAAG,8CAA8C,EACtD,QAAQ,GAAG,iHAAiH,EAC5H,IAAI,EACJ,UAAU,GAAG,EAAE,GAChB,KAAI;IACH,MAAM,EAAE,EAAE,EAAE,gBAAgB,EAAE,GAAG,iBAAiB,EAAE,GAAG,cAAc;IACrE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,gBAAgB,EAAE,GAAG,aAAa;IAClE,MAAM,EAAE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AA,CACK,EACbD,cAAA,CAACC,kBAAU,IAAC,EAAE,EAAE,EAAE,GAAG,eAAe,EAAE,EAAA,GAAM,gBAAgB,YACzD,QAAQ,EAAA,CACE,EACbD,cAAA,CAACE,cAAM,IACL,gBAAgB,EAAA,IAAA,EAChB,aAAa,EAAA,IAAA,EACb,kBAAkB,QAClB,kBAAkB,EAAA,IAAA,EAClB,EAAE,EAAE;AACF,oBAAA,UAAU,EAAE,SAAS;AACrB,oBAAA,SAAS,EAAE;AACT,wBAAA,eAAe,EAAE,SAAS;AAC3B,qBAAA;AACD,oBAAA,GAAG,aAAa;iBACjB,EACD,OAAO,EAAE,MAAM,YAAY,EAAE,EAAA,GACzB,eAAe,EAAA,QAAA,EAClB,UAAU,EAAA,CACJ,EACTF,cAAA,CAACE,cAAM,EAAA,EACL,gBAAgB,EAAA,IAAA,EAChB,aAAa,EAAA,IAAA,EACb,kBAAkB,EAAA,IAAA,EAClB,kBAAkB,EAAA,IAAA,EAClB,EAAE,EAAE;AACF,oBAAA,cAAc,EAAE,WAAW;AAC3B,oBAAA,UAAU,EAAE,aAAa;AACzB,oBAAA,OAAO,EAAE,aAAa;AACtB,oBAAA,GAAG,sBAAsB;AAC1B,iBAAA,EACD,OAAO,EAAE,MAAM,qBAAqB,EAAE,EAAA,GAClC,wBAAwB,EAAA,QAAA,EAC3B,mBAAmB,EAAA,CACb,CAAA,EAAA,CACL;AAEV;;;;"}
1
+ {"version":3,"file":"PaywallSubscription.js","sources":["../../../../src/components/paywall/PaywallSubscription.tsx"],"sourcesContent":["import React from 'react';\nimport { Box, BoxProps, Typography, TypographyProps, ButtonProps, Button } from '@mui/material';\nimport { PAYWALL_AUTH_ENDPOINT } from './paywall.constants';\n\nexport interface PaywallSubscriptionProps {\n post?: any;\n containerProps?: BoxProps;\n titleProps?: TypographyProps;\n subtitleProps?: TypographyProps;\n buttonProps?: ButtonProps;\n buttonText?: string;\n secondaryButtonProps?: ButtonProps;\n secondaryButtonText?: string;\n title?: string;\n subtitle?: string;\n withCaption?: boolean;\n}\n\nexport const PaywallSubscription: React.FC<PaywallSubscriptionProps> = ({\n containerProps = {},\n subtitleProps = {},\n buttonProps = {},\n titleProps = {},\n secondaryButtonText = '',\n secondaryButtonProps = {},\n withCaption = false,\n title = 'Este artículo es exclusivo para suscriptores',\n subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.',\n post,\n buttonText = 'Suscríbete',\n}) => {\n const { sx: sxContainerProps, ...containerPropRest } = containerProps;\n const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;\n const { sx: sxTitleProps, ...titlePropRest } = titleProps;\n const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;\n const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;\n\n const handleButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/planes?post_url=${window.location.href}`);\n };\n\n const handleSecondaryButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);\n };\n\n return (\n <Box\n sx={{\n height: withCaption ? 220 : 300,\n width: '100%',\n border: '1px solid #707070',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n background: 'white',\n paddingTop: 80,\n paddingBottom: 80,\n ...sxContainerProps,\n }}\n {...containerPropRest}>\n <Box\n sx={{\n width: {\n xs: 360,\n md: 460,\n },\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n }}>\n <Typography sx={{ fontWeight: 500, ...sxTitleProps }} {...titlePropRest}>\n {title}\n </Typography>\n <Typography sx={{ ...sxSubtitleProps }} {...subtitlePropRest}>\n {subtitle}\n </Typography>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n background: '#f75957',\n '&:hover': {\n backgroundColor: '#f75957',\n },\n ...sxButtonProps,\n }}\n onClick={() => handleButton()}\n {...buttonPropsRest}>\n {buttonText}\n </Button>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n textDecoration: 'underline',\n background: 'transparent',\n padding: '0.5rem 1rem',\n fontWeight: 500,\n ...sxSecondaryButtonProps,\n }}\n onClick={() => handleSecondaryButton()}\n {...secondaryButtonPropsRest}>\n {secondaryButtonText}\n </Button>\n </Box>\n </Box>\n );\n};\n"],"names":["PAYWALL_AUTH_ENDPOINT","_jsx","Box","_jsxs","Typography","Button"],"mappings":";;;;;;;;MAkBa,mBAAmB,GAAuC,CAAC,EACtE,cAAc,GAAG,EAAE,EACnB,aAAa,GAAG,EAAE,EAClB,WAAW,GAAG,EAAE,EAChB,UAAU,GAAG,EAAE,EACf,mBAAmB,GAAG,EAAE,EACxB,oBAAoB,GAAG,EAAE,EACzB,WAAW,GAAG,KAAK,EACnB,KAAK,GAAG,8CAA8C,EACtD,QAAQ,GAAG,iHAAiH,EAC5H,IAAI,EACJ,UAAU,GAAG,YAAY,GAC1B,KAAI;IACH,MAAM,EAAE,EAAE,EAAE,gBAAgB,EAAE,GAAG,iBAAiB,EAAE,GAAG,cAAc;IACrE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,gBAAgB,EAAE,GAAG,aAAa;IAClE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,aAAa,EAAE,GAAG,UAAU;IACzD,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,eAAe,EAAE,GAAG,WAAW;IAC7D,MAAM,EAAE,EAAE,EAAE,sBAAsB,EAAE,GAAG,wBAAwB,EAAE,GAAG,oBAAoB;IAExF,MAAM,YAAY,GAAG,MAAK;QACxB,IAAI,CAACA,uCAAqB,EAAE;AAC1B,YAAA,OAA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,kBAAU,EAAA,EAAC,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,KAAM,aAAa,EAAA,QAAA,EACpE,KAAK,EAAA,CACK,EACbH,cAAA,CAACG,kBAAU,EAAA,EAAC,EAAE,EAAE,EAAE,GAAG,eAAe,EAAE,EAAA,GAAM,gBAAgB,EAAA,QAAA,EACzD,QAAQ,GACE,EACbH,cAAA,CAACI,cAAM,EAAA,EACL,gBAAgB,QAChB,aAAa,EAAA,IAAA,EACb,kBAAkB,EAAA,IAAA,EAClB,kBAAkB,EAAA,IAAA,EAClB,EAAE,EAAE;AACF,wBAAA,UAAU,EAAE,SAAS;AACrB,wBAAA,SAAS,EAAE;AACT,4BAAA,eAAe,EAAE,SAAS;AAC3B,yBAAA;AACD,wBAAA,GAAG,aAAa;qBACjB,EACD,OAAO,EAAE,MAAM,YAAY,EAAE,EAAA,GACzB,eAAe,EAAA,QAAA,EAClB,UAAU,EAAA,CACJ,EACTJ,cAAA,CAACI,cAAM,EAAA,EACL,gBAAgB,EAAA,IAAA,EAChB,aAAa,EAAA,IAAA,EACb,kBAAkB,EAAA,IAAA,EAClB,kBAAkB,EAAA,IAAA,EAClB,EAAE,EAAE;AACF,wBAAA,cAAc,EAAE,WAAW;AAC3B,wBAAA,UAAU,EAAE,aAAa;AACzB,wBAAA,OAAO,EAAE,aAAa;AACtB,wBAAA,UAAU,EAAE,GAAG;AACf,wBAAA,GAAG,sBAAsB;AAC1B,qBAAA,EACD,OAAO,EAAE,MAAM,qBAAqB,EAAE,EAAA,GAClC,wBAAwB,YAC3B,mBAAmB,EAAA,CACb,CAAA,EAAA,CACL,EAAA,CACF;AAEV;;;;"}
@@ -3,6 +3,7 @@
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
+ var generated = require('../../shared/types/generated.js');
6
7
  var SessionUserContext = require('./SessionUserContext.js');
7
8
  var theme = require('../../shared/mui/theme.js');
8
9
  var ThemeProvider = require('../../node_modules/@mui/material/esm/styles/ThemeProvider.js');
@@ -13,7 +14,7 @@ const SessionUserProvider = ({ children, initial, config, }) => {
13
14
  const values = {
14
15
  user,
15
16
  config,
16
- subscription: { id: 1 },
17
+ subscription: user?.subscriptions?.find((item) => item?.status === generated.SubscriptionStatuses.Active),
17
18
  };
18
19
  return (jsxRuntime.jsx(SessionUserContext.Provider, { value: values, children: jsxRuntime.jsxs(ThemeProvider.default, { theme: theme.theme, children: [jsxRuntime.jsx(CssBaseline.default, {}), children] }) }));
19
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SessionUserProvider.js","sources":["../../../../src/components/session/SessionUserProvider.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport { User } from '../../shared/types/generated';\nimport { Provider } from './SessionUserContext';\nimport { SessionContextDefaultValues } from './session.types';\nimport { Config } from '../../config/config.types';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { theme } from '../../shared/mui/theme';\n\ntype SessionUserProviderProps = {\n children: React.ReactNode;\n initial: User | null | undefined;\n config: Config;\n};\n\nexport const SessionUserProvider: React.FC<SessionUserProviderProps> = ({\n children,\n initial,\n config,\n}) => {\n const [user] = useState<User | null | undefined>(initial);\n\n const values: SessionContextDefaultValues = {\n user,\n config,\n subscription: { id: 1 },\n };\n return (\n <Provider value={values}>\n <ThemeProvider theme={theme}>\n <CssBaseline />\n\n {children}\n </ThemeProvider>\n </Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAgBO;;AAOL;;;AAGE;;;AAWJ;;"}
1
+ {"version":3,"file":"SessionUserProvider.js","sources":["../../../../src/components/session/SessionUserProvider.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport { SubscriptionStatuses, User } from '../../shared/types/generated';\nimport { Provider } from './SessionUserContext';\nimport { SessionContextDefaultValues } from './session.types';\nimport { Config } from '../../config/config.types';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { theme } from '../../shared/mui/theme';\n\ntype SessionUserProviderProps = {\n children: React.ReactNode;\n initial: User | null | undefined;\n config: Config;\n};\n\nexport const SessionUserProvider: React.FC<SessionUserProviderProps> = ({\n children,\n initial,\n config,\n}) => {\n const [user] = useState<User | null | undefined>(initial);\n\n const values: SessionContextDefaultValues = {\n user,\n config,\n subscription: user?.subscriptions?.find((item) => item?.status === SubscriptionStatuses.Active),\n };\n return (\n <Provider value={values}>\n <ThemeProvider theme={theme}>\n <CssBaseline />\n\n {children}\n </ThemeProvider>\n </Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAgBO;;AAOL;;;AAGE;;;AAWJ;;"}
@@ -1,10 +1,10 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { PAYWALL_AUTH_ENDPOINT } from './paywall.constants.js';
3
3
  import Box from '../../node_modules/@mui/material/esm/Box/Box.js';
4
4
  import Typography from '../../node_modules/@mui/material/esm/Typography/Typography.js';
5
5
  import Button from '../../node_modules/@mui/material/esm/Button/Button.js';
6
6
 
7
- const PaywallSubscription = ({ containerProps = {}, subtitleProps = {}, buttonProps = {}, titleProps = {}, secondaryButtonText = '', secondaryButtonProps = {}, withCaption = false, title = 'Este artículo es exclusivo para suscriptores', subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.', post, buttonText = '', }) => {
7
+ const PaywallSubscription = ({ containerProps = {}, subtitleProps = {}, buttonProps = {}, titleProps = {}, secondaryButtonText = '', secondaryButtonProps = {}, withCaption = false, title = 'Este artículo es exclusivo para suscriptores', subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.', post, buttonText = 'Suscríbete', }) => {
8
8
  const { sx: sxContainerProps, ...containerPropRest } = containerProps;
9
9
  const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;
10
10
  const { sx: sxTitleProps, ...titlePropRest } = titleProps;
@@ -24,26 +24,38 @@ const PaywallSubscription = ({ containerProps = {}, subtitleProps = {}, buttonPr
24
24
  }
25
25
  return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);
26
26
  };
27
- return (jsxs(Box, { sx: {
27
+ return (jsx(Box, { sx: {
28
28
  height: withCaption ? 220 : 300,
29
29
  width: '100%',
30
30
  border: '1px solid #707070',
31
31
  justifyContent: 'center',
32
32
  alignItems: 'center',
33
33
  flexDirection: 'column',
34
+ background: 'white',
35
+ paddingTop: 80,
36
+ paddingBottom: 80,
34
37
  ...sxContainerProps,
35
- }, ...containerPropRest, children: [jsx(Typography, { sx: { ...sxTitleProps }, ...titlePropRest, children: title }), jsx(Typography, { sx: { ...sxSubtitleProps }, ...subtitlePropRest, children: subtitle }), jsx(Button, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
36
- background: '#f75957',
37
- '&:hover': {
38
- backgroundColor: '#f75957',
39
- },
40
- ...sxButtonProps,
41
- }, onClick: () => handleButton(), ...buttonPropsRest, children: buttonText }), jsx(Button, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
42
- textDecoration: 'underline',
43
- background: 'transparent',
44
- padding: '0.5rem 1rem',
45
- ...sxSecondaryButtonProps,
46
- }, onClick: () => handleSecondaryButton(), ...secondaryButtonPropsRest, children: secondaryButtonText })] }));
38
+ }, ...containerPropRest, children: jsxs(Box, { sx: {
39
+ width: {
40
+ xs: 360,
41
+ md: 460,
42
+ },
43
+ justifyContent: 'center',
44
+ alignItems: 'center',
45
+ flexDirection: 'column',
46
+ }, children: [jsx(Typography, { sx: { fontWeight: 500, ...sxTitleProps }, ...titlePropRest, children: title }), jsx(Typography, { sx: { ...sxSubtitleProps }, ...subtitlePropRest, children: subtitle }), jsx(Button, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
47
+ background: '#f75957',
48
+ '&:hover': {
49
+ backgroundColor: '#f75957',
50
+ },
51
+ ...sxButtonProps,
52
+ }, onClick: () => handleButton(), ...buttonPropsRest, children: buttonText }), jsx(Button, { disableElevation: true, disableRipple: true, disableTouchRipple: true, disableFocusRipple: true, sx: {
53
+ textDecoration: 'underline',
54
+ background: 'transparent',
55
+ padding: '0.5rem 1rem',
56
+ fontWeight: 500,
57
+ ...sxSecondaryButtonProps,
58
+ }, onClick: () => handleSecondaryButton(), ...secondaryButtonPropsRest, children: secondaryButtonText })] }) }));
47
59
  };
48
60
 
49
61
  export { PaywallSubscription };
@@ -1 +1 @@
1
- {"version":3,"file":"PaywallSubscription.js","sources":["../../../../src/components/paywall/PaywallSubscription.tsx"],"sourcesContent":["import React from 'react';\nimport { Box, BoxProps, Typography, TypographyProps, ButtonProps, Button } from '@mui/material';\nimport { PAYWALL_AUTH_ENDPOINT } from './paywall.constants';\n\nexport interface PaywallSubscriptionProps {\n post?: any;\n containerProps?: BoxProps;\n titleProps?: TypographyProps;\n subtitleProps?: TypographyProps;\n buttonProps?: ButtonProps;\n buttonText?: string;\n secondaryButtonProps?: ButtonProps;\n secondaryButtonText?: string;\n title?: string;\n subtitle?: string;\n withCaption?: boolean;\n}\n\nexport const PaywallSubscription: React.FC<PaywallSubscriptionProps> = ({\n containerProps = {},\n subtitleProps = {},\n buttonProps = {},\n titleProps = {},\n secondaryButtonText = '',\n secondaryButtonProps = {},\n withCaption = false,\n title = 'Este artículo es exclusivo para suscriptores',\n subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.',\n post,\n buttonText = '',\n}) => {\n const { sx: sxContainerProps, ...containerPropRest } = containerProps;\n const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;\n const { sx: sxTitleProps, ...titlePropRest } = titleProps;\n const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;\n const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;\n\n const handleButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/planes?post_url=${window.location.href}`);\n };\n\n const handleSecondaryButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);\n };\n\n return (\n <Box\n sx={{\n height: withCaption ? 220 : 300,\n width: '100%',\n border: '1px solid #707070',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n ...sxContainerProps,\n }}\n {...containerPropRest}>\n <Typography sx={{ ...sxTitleProps }} {...titlePropRest}>\n {title}\n </Typography>\n <Typography sx={{ ...sxSubtitleProps }} {...subtitlePropRest}>\n {subtitle}\n </Typography>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n background: '#f75957',\n '&:hover': {\n backgroundColor: '#f75957',\n },\n ...sxButtonProps,\n }}\n onClick={() => handleButton()}\n {...buttonPropsRest}>\n {buttonText}\n </Button>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n textDecoration: 'underline',\n background: 'transparent',\n padding: '0.5rem 1rem',\n ...sxSecondaryButtonProps,\n }}\n onClick={() => handleSecondaryButton()}\n {...secondaryButtonPropsRest}>\n {secondaryButtonText}\n </Button>\n </Box>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;MAkBa,mBAAmB,GAAuC,CAAC,EACtE,cAAc,GAAG,EAAE,EACnB,aAAa,GAAG,EAAE,EAClB,WAAW,GAAG,EAAE,EAChB,UAAU,GAAG,EAAE,EACf,mBAAmB,GAAG,EAAE,EACxB,oBAAoB,GAAG,EAAE,EACzB,WAAW,GAAG,KAAK,EACnB,KAAK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,mBAAmB;AAC3B,YAAA,cAAc,EAAE,QAAQ;AACxB,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,aAAa,EAAE,QAAQ;AACvB,YAAA,GAAG,gBAAgB;SACpB,EAAA,GACG,iBAAiB,aACrBC,GAAA,CAAC,UAAU,IAAC,EAAE,EAAE,EAAE,GAAG,YAAY,EAAE,EAAA,GAAM,aAAa,YACnD,KAAK,EAAA,CACK,EACbA,GAAA,CAAC,UAAU,IAAC,EAAE,EAAE,EAAE,GAAG,eAAe,EAAE,EAAA,GAAM,gBAAgB,YACzD,QAAQ,EAAA,CACE,EACbA,GAAA,CAAC,MAAM,IACL,gBAAgB,EAAA,IAAA,EAChB,aAAa,EAAA,IAAA,EACb,kBAAkB,QAClB,kBAAkB,EAAA,IAAA,EAClB,EAAE,EAAE;AACF,oBAAA,UAAU,EAAE,SAAS;AACrB,oBAAA,SAAS,EAAE;AACT,wBAAA,eAAe,EAAE,SAAS;AAC3B,qBAAA;AACD,oBAAA,GAAG,aAAa;iBACjB,EACD,OAAO,EAAE,MAAM,YAAY,EAAE,EAAA,GACzB,eAAe,EAAA,QAAA,EAClB,UAAU,EAAA,CACJ,EACTA,GAAA,CAAC,MAAM,EAAA,EACL,gBAAgB,EAAA,IAAA,EAChB,aAAa,EAAA,IAAA,EACb,kBAAkB,EAAA,IAAA,EAClB,kBAAkB,EAAA,IAAA,EAClB,EAAE,EAAE;AACF,oBAAA,cAAc,EAAE,WAAW;AAC3B,oBAAA,UAAU,EAAE,aAAa;AACzB,oBAAA,OAAO,EAAE,aAAa;AACtB,oBAAA,GAAG,sBAAsB;AAC1B,iBAAA,EACD,OAAO,EAAE,MAAM,qBAAqB,EAAE,EAAA,GAClC,wBAAwB,EAAA,QAAA,EAC3B,mBAAmB,EAAA,CACb,CAAA,EAAA,CACL;AAEV;;;;"}
1
+ {"version":3,"file":"PaywallSubscription.js","sources":["../../../../src/components/paywall/PaywallSubscription.tsx"],"sourcesContent":["import React from 'react';\nimport { Box, BoxProps, Typography, TypographyProps, ButtonProps, Button } from '@mui/material';\nimport { PAYWALL_AUTH_ENDPOINT } from './paywall.constants';\n\nexport interface PaywallSubscriptionProps {\n post?: any;\n containerProps?: BoxProps;\n titleProps?: TypographyProps;\n subtitleProps?: TypographyProps;\n buttonProps?: ButtonProps;\n buttonText?: string;\n secondaryButtonProps?: ButtonProps;\n secondaryButtonText?: string;\n title?: string;\n subtitle?: string;\n withCaption?: boolean;\n}\n\nexport const PaywallSubscription: React.FC<PaywallSubscriptionProps> = ({\n containerProps = {},\n subtitleProps = {},\n buttonProps = {},\n titleProps = {},\n secondaryButtonText = '',\n secondaryButtonProps = {},\n withCaption = false,\n title = 'Este artículo es exclusivo para suscriptores',\n subtitle = 'Tu contribución nos ayuda a cubrir costos de investigación, tecnología y ofrecerte servicios de valor agregado.',\n post,\n buttonText = 'Suscríbete',\n}) => {\n const { sx: sxContainerProps, ...containerPropRest } = containerProps;\n const { sx: sxSubtitleProps, ...subtitlePropRest } = subtitleProps;\n const { sx: sxTitleProps, ...titlePropRest } = titleProps;\n const { sx: sxButtonProps, ...buttonPropsRest } = buttonProps;\n const { sx: sxSecondaryButtonProps, ...secondaryButtonPropsRest } = secondaryButtonProps;\n\n const handleButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/planes?post_url=${window.location.href}`);\n };\n\n const handleSecondaryButton = () => {\n if (!PAYWALL_AUTH_ENDPOINT) {\n console.error('PAYWALL_AUTH_ENDPOINT is required!');\n return null;\n }\n\n return (window.location.href = `${PAYWALL_AUTH_ENDPOINT}/autenticacion?action=AUTH_LOGIN?post_url=${window.location.href}`);\n };\n\n return (\n <Box\n sx={{\n height: withCaption ? 220 : 300,\n width: '100%',\n border: '1px solid #707070',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n background: 'white',\n paddingTop: 80,\n paddingBottom: 80,\n ...sxContainerProps,\n }}\n {...containerPropRest}>\n <Box\n sx={{\n width: {\n xs: 360,\n md: 460,\n },\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n }}>\n <Typography sx={{ fontWeight: 500, ...sxTitleProps }} {...titlePropRest}>\n {title}\n </Typography>\n <Typography sx={{ ...sxSubtitleProps }} {...subtitlePropRest}>\n {subtitle}\n </Typography>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n background: '#f75957',\n '&:hover': {\n backgroundColor: '#f75957',\n },\n ...sxButtonProps,\n }}\n onClick={() => handleButton()}\n {...buttonPropsRest}>\n {buttonText}\n </Button>\n <Button\n disableElevation\n disableRipple\n disableTouchRipple\n disableFocusRipple\n sx={{\n textDecoration: 'underline',\n background: 'transparent',\n padding: '0.5rem 1rem',\n fontWeight: 500,\n ...sxSecondaryButtonProps,\n }}\n onClick={() => handleSecondaryButton()}\n {...secondaryButtonPropsRest}>\n {secondaryButtonText}\n </Button>\n </Box>\n </Box>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;MAkBa,mBAAmB,GAAuC,CAAC,EACtE,cAAc,GAAG,EAAE,EACnB,aAAa,GAAG,EAAE,EAClB,WAAW,GAAG,EAAE,EAChB,UAAU,GAAG,EAAE,EACf,mBAAmB,GAAG,EAAE,EACxB,oBAAoB,GAAG,EAAE,EACzB,WAAW,GAAG,KAAK,EACnB,KAAK,GAAG,8CAA8C,EACtD,QAAQ,GAAG,iHAAiH,EAC5H,IAAI,EACJ,UAAU,GAAG,YAAY,GAC1B,KAAI;IACH,MAAM,EAAE,EAAE,EAAE,gBAAgB,EAAE,GAAG,iBAAiB,EAAE,GAAG,cAAc;IACrE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,gBAAgB,EAAE,GAAG,aAAa;IAClE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,aAAa,EAAE,GAAG,UAAU;IACzD,MAAM,EAA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CACL,EAAA,CACF;AAEV;;;;"}
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useState } from 'react';
4
+ import { SubscriptionStatuses } from '../../shared/types/generated.js';
4
5
  import { Provider } from './SessionUserContext.js';
5
6
  import { theme } from '../../shared/mui/theme.js';
6
7
  import ThemeProvider from '../../node_modules/@mui/material/esm/styles/ThemeProvider.js';
@@ -11,7 +12,7 @@ const SessionUserProvider = ({ children, initial, config, }) => {
11
12
  const values = {
12
13
  user,
13
14
  config,
14
- subscription: { id: 1 },
15
+ subscription: user?.subscriptions?.find((item) => item?.status === SubscriptionStatuses.Active),
15
16
  };
16
17
  return (jsx(Provider, { value: values, children: jsxs(ThemeProvider, { theme: theme, children: [jsx(CssBaseline, {}), children] }) }));
17
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SessionUserProvider.js","sources":["../../../../src/components/session/SessionUserProvider.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport { User } from '../../shared/types/generated';\nimport { Provider } from './SessionUserContext';\nimport { SessionContextDefaultValues } from './session.types';\nimport { Config } from '../../config/config.types';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { theme } from '../../shared/mui/theme';\n\ntype SessionUserProviderProps = {\n children: React.ReactNode;\n initial: User | null | undefined;\n config: Config;\n};\n\nexport const SessionUserProvider: React.FC<SessionUserProviderProps> = ({\n children,\n initial,\n config,\n}) => {\n const [user] = useState<User | null | undefined>(initial);\n\n const values: SessionContextDefaultValues = {\n user,\n config,\n subscription: { id: 1 },\n };\n return (\n <Provider value={values}>\n <ThemeProvider theme={theme}>\n <CssBaseline />\n\n {children}\n </ThemeProvider>\n </Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAgBO;;AAOL;;;AAGE;;;AAWJ;;"}
1
+ {"version":3,"file":"SessionUserProvider.js","sources":["../../../../src/components/session/SessionUserProvider.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport { SubscriptionStatuses, User } from '../../shared/types/generated';\nimport { Provider } from './SessionUserContext';\nimport { SessionContextDefaultValues } from './session.types';\nimport { Config } from '../../config/config.types';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { theme } from '../../shared/mui/theme';\n\ntype SessionUserProviderProps = {\n children: React.ReactNode;\n initial: User | null | undefined;\n config: Config;\n};\n\nexport const SessionUserProvider: React.FC<SessionUserProviderProps> = ({\n children,\n initial,\n config,\n}) => {\n const [user] = useState<User | null | undefined>(initial);\n\n const values: SessionContextDefaultValues = {\n user,\n config,\n subscription: user?.subscriptions?.find((item) => item?.status === SubscriptionStatuses.Active),\n };\n return (\n <Provider value={values}>\n <ThemeProvider theme={theme}>\n <CssBaseline />\n\n {children}\n </ThemeProvider>\n </Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAgBO;;AAOL;;;AAGE;;;AAWJ;;"}
@@ -3,5 +3,5 @@ import { Config } from '../../config/config.types';
3
3
  export type SessionContextDefaultValues = {
4
4
  user?: User | null;
5
5
  config?: Config;
6
- subscription?: Subscription;
6
+ subscription?: Subscription | null;
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-easy-wall",
3
- "version": "1.1.3",
3
+ "version": "1.1.6",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/index.d.ts",