react-easy-wall 1.2.6 → 1.2.7
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/panel/PanelButton.js +7 -5
- package/dist/cjs/components/panel/PanelButton.js.map +1 -1
- package/dist/esm/components/panel/PanelButton.js +7 -5
- package/dist/esm/components/panel/PanelButton.js.map +1 -1
- package/dist/esm/types/components/panel/PanelButton.d.ts +3 -2
- package/dist/index.d.ts +3 -2
- package/package.json +1 -1
|
@@ -9,17 +9,19 @@ var session_hooks = require('../session/session.hooks.js');
|
|
|
9
9
|
var index$1 = require('../../shared/constants/index.js');
|
|
10
10
|
var Button = require('../../node_modules/@mui/material/esm/Button/Button.js');
|
|
11
11
|
|
|
12
|
-
const PanelButton = ({
|
|
12
|
+
const PanelButton = ({ loginButtonText = 'CUENTA', registerButtonText = 'INGRESAR', registerButtonProps, loginButtonProps, params = {}, }) => {
|
|
13
13
|
const { isOpen } = index.libExports.useStore(panel_store.panelStore);
|
|
14
14
|
const { user } = session_hooks.useSession();
|
|
15
15
|
const handleClick = () => {
|
|
16
16
|
if (user)
|
|
17
17
|
return panel_actions.handlePanelClick(!isOpen);
|
|
18
18
|
let url = `${index$1.URL_PORTAL}/autenticacion`;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const queryParams = {
|
|
20
|
+
redirect_url: window.location.href,
|
|
21
|
+
...params,
|
|
22
|
+
};
|
|
23
|
+
const queryString = new URLSearchParams(queryParams).toString();
|
|
24
|
+
return (window.location.href = `${url}?${queryString}`);
|
|
23
25
|
};
|
|
24
26
|
if (user) {
|
|
25
27
|
return (jsxRuntime.jsx(Button.default, { onClick: handleClick, ...loginButtonProps, children: loginButtonText }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelButton.js","sources":["../../../../src/components/panel/PanelButton.tsx"],"sourcesContent":["'use client';\nimport React, { FC } from 'react';\nimport { Button, ButtonProps } from '@mui/material';\nimport { handlePanelClick } from './panel.actions';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { panelStore } from './panel.store';\nimport { useSession } from '../session/session.hooks';\nimport { URL_PORTAL } from '../../shared/constants';\n\nexport interface PanelButtonProps {\n
|
|
1
|
+
{"version":3,"file":"PanelButton.js","sources":["../../../../src/components/panel/PanelButton.tsx"],"sourcesContent":["'use client';\nimport React, { FC } from 'react';\nimport { Button, ButtonProps } from '@mui/material';\nimport { handlePanelClick } from './panel.actions';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { panelStore } from './panel.store';\nimport { useSession } from '../session/session.hooks';\nimport { URL_PORTAL } from '../../shared/constants';\n\nexport interface PanelButtonProps {\n params?: { [key: string]: string };\n loginButtonText?: string | React.ReactNode;\n registerButtonText?: string | React.ReactNode;\n registerButtonProps?: ButtonProps;\n loginButtonProps?: ButtonProps;\n}\n\nexport const PanelButton: FC<PanelButtonProps> = ({\n loginButtonText = 'CUENTA',\n registerButtonText = 'INGRESAR',\n registerButtonProps,\n loginButtonProps,\n params = {},\n}) => {\n const { isOpen } = useStore(panelStore);\n const { user } = useSession();\n\n const handleClick = () => {\n if (user) return handlePanelClick(!isOpen);\n\n let url = `${URL_PORTAL}/autenticacion`;\n\n const queryParams = {\n redirect_url: window.location.href,\n ...params,\n };\n\n const queryString = new URLSearchParams(queryParams).toString();\n\n return (window.location.href = `${url}?${queryString}`);\n };\n\n if (user) {\n return (\n <Button onClick={handleClick} {...loginButtonProps}>\n {loginButtonText}\n </Button>\n );\n }\n\n return (\n <Button onClick={handleClick} {...registerButtonProps}>\n {registerButtonText}\n </Button>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyBE;;AAGE;AAAU;AAEV;AAEA;AACE;AACA;;;AAKF;AACF;;AAGE;;AAOF;AAKF;;"}
|
|
@@ -7,17 +7,19 @@ import { useSession } from '../session/session.hooks.js';
|
|
|
7
7
|
import { URL_PORTAL } from '../../shared/constants/index.js';
|
|
8
8
|
import Button from '../../node_modules/@mui/material/esm/Button/Button.js';
|
|
9
9
|
|
|
10
|
-
const PanelButton = ({
|
|
10
|
+
const PanelButton = ({ loginButtonText = 'CUENTA', registerButtonText = 'INGRESAR', registerButtonProps, loginButtonProps, params = {}, }) => {
|
|
11
11
|
const { isOpen } = libExports.useStore(panelStore);
|
|
12
12
|
const { user } = useSession();
|
|
13
13
|
const handleClick = () => {
|
|
14
14
|
if (user)
|
|
15
15
|
return handlePanelClick(!isOpen);
|
|
16
16
|
let url = `${URL_PORTAL}/autenticacion`;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const queryParams = {
|
|
18
|
+
redirect_url: window.location.href,
|
|
19
|
+
...params,
|
|
20
|
+
};
|
|
21
|
+
const queryString = new URLSearchParams(queryParams).toString();
|
|
22
|
+
return (window.location.href = `${url}?${queryString}`);
|
|
21
23
|
};
|
|
22
24
|
if (user) {
|
|
23
25
|
return (jsx(Button, { onClick: handleClick, ...loginButtonProps, children: loginButtonText }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelButton.js","sources":["../../../../src/components/panel/PanelButton.tsx"],"sourcesContent":["'use client';\nimport React, { FC } from 'react';\nimport { Button, ButtonProps } from '@mui/material';\nimport { handlePanelClick } from './panel.actions';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { panelStore } from './panel.store';\nimport { useSession } from '../session/session.hooks';\nimport { URL_PORTAL } from '../../shared/constants';\n\nexport interface PanelButtonProps {\n
|
|
1
|
+
{"version":3,"file":"PanelButton.js","sources":["../../../../src/components/panel/PanelButton.tsx"],"sourcesContent":["'use client';\nimport React, { FC } from 'react';\nimport { Button, ButtonProps } from '@mui/material';\nimport { handlePanelClick } from './panel.actions';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { panelStore } from './panel.store';\nimport { useSession } from '../session/session.hooks';\nimport { URL_PORTAL } from '../../shared/constants';\n\nexport interface PanelButtonProps {\n params?: { [key: string]: string };\n loginButtonText?: string | React.ReactNode;\n registerButtonText?: string | React.ReactNode;\n registerButtonProps?: ButtonProps;\n loginButtonProps?: ButtonProps;\n}\n\nexport const PanelButton: FC<PanelButtonProps> = ({\n loginButtonText = 'CUENTA',\n registerButtonText = 'INGRESAR',\n registerButtonProps,\n loginButtonProps,\n params = {},\n}) => {\n const { isOpen } = useStore(panelStore);\n const { user } = useSession();\n\n const handleClick = () => {\n if (user) return handlePanelClick(!isOpen);\n\n let url = `${URL_PORTAL}/autenticacion`;\n\n const queryParams = {\n redirect_url: window.location.href,\n ...params,\n };\n\n const queryString = new URLSearchParams(queryParams).toString();\n\n return (window.location.href = `${url}?${queryString}`);\n };\n\n if (user) {\n return (\n <Button onClick={handleClick} {...loginButtonProps}>\n {loginButtonText}\n </Button>\n );\n }\n\n return (\n <Button onClick={handleClick} {...registerButtonProps}>\n {registerButtonText}\n </Button>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAyBE;;AAGE;AAAU;AAEV;AAEA;AACE;AACA;;;AAKF;AACF;;AAGE;;AAOF;AAKF;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material';
|
|
3
3
|
export interface PanelButtonProps {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
params?: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
6
7
|
loginButtonText?: string | React.ReactNode;
|
|
7
8
|
registerButtonText?: string | React.ReactNode;
|
|
8
9
|
registerButtonProps?: ButtonProps;
|
package/dist/index.d.ts
CHANGED
|
@@ -29,8 +29,9 @@ interface PanelDividerProps extends DividerProps {
|
|
|
29
29
|
declare const PanelDivider: React__default.FC<PanelDividerProps>;
|
|
30
30
|
|
|
31
31
|
interface PanelButtonProps {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
params?: {
|
|
33
|
+
[key: string]: string;
|
|
34
|
+
};
|
|
34
35
|
loginButtonText?: string | React__default.ReactNode;
|
|
35
36
|
registerButtonText?: string | React__default.ReactNode;
|
|
36
37
|
registerButtonProps?: ButtonProps;
|