react-easy-wall 3.5.13 → 3.5.15
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/comment/components/create-comment/CreateComment.js +37 -34
- package/dist/cjs/components/comment/components/create-comment/CreateComment.js.map +1 -1
- package/dist/esm/components/comment/components/create-comment/CreateComment.js +37 -34
- package/dist/esm/components/comment/components/create-comment/CreateComment.js.map +1 -1
- package/dist/esm/types/components/comment/components/create-comment/CreateComment.d.ts +4 -1
- package/dist/index.d.ts +4 -1
- package/package.json +1 -1
|
@@ -26,14 +26,17 @@ var Box = require('../../../../node_modules/@mui/material/esm/Box/Box.js');
|
|
|
26
26
|
var Avatar = require('../../../../node_modules/@mui/material/esm/Avatar/Avatar.js');
|
|
27
27
|
var Typography = require('../../../../node_modules/@mui/material/esm/Typography/Typography.js');
|
|
28
28
|
|
|
29
|
-
const CreateComment = ({ createCommentAvatarProps = {}, createCommentNameTextProps = {}, createCommentButtonProps = {}, createCommentContentProps = {},
|
|
29
|
+
const CreateComment = ({ createCommentAvatarProps = {}, createAvatarContainerProps = {}, createCommentNameTextProps = {}, createCommentButtonProps = {}, createCommentContentProps = {}, createButtonContainerProps = {}, createTextContainerProps = {}, createCommentContainerProps = {}, }) => {
|
|
30
30
|
const { user, subscription } = session_hooks.useSession();
|
|
31
31
|
const [html, setHtml] = React.useState('');
|
|
32
32
|
const { callAction, postId, onlyForRegistered, onlyForSubscribers } = comment_hooks.useComment();
|
|
33
33
|
const { sx: sxCreateCommentAvatarProps } = createCommentAvatarProps;
|
|
34
34
|
const { sx: sxCreateCommentNameTextProps } = createCommentNameTextProps;
|
|
35
35
|
const { sx: sxCreateCommentButtonProps } = createCommentButtonProps;
|
|
36
|
-
const { sx:
|
|
36
|
+
const { sx: sxCreateButtonContainerProps } = createButtonContainerProps;
|
|
37
|
+
const { sx: sxCreateAvatarContainerProps } = createAvatarContainerProps;
|
|
38
|
+
const { sx: sxCreateTextContainerProps } = createTextContainerProps;
|
|
39
|
+
const { sx: sxCreateCommentContainerProps } = createCommentContainerProps;
|
|
37
40
|
const [callCreateComment, loading] = index.libExports.useCallAction(comment_actions.createComment, {
|
|
38
41
|
onCompleted: () => {
|
|
39
42
|
setHtml('');
|
|
@@ -43,39 +46,39 @@ const CreateComment = ({ createCommentAvatarProps = {}, createCommentNameTextPro
|
|
|
43
46
|
const canRegistered = onlyForRegistered && user;
|
|
44
47
|
const canSubscriber = onlyForSubscribers && subscription;
|
|
45
48
|
const canComment = canRegistered || canSubscriber;
|
|
46
|
-
return (jsxRuntime.jsx(Card.default, { elevation: 0, children: jsxRuntime.jsxs(Box.default, { sx: { display: { xs: 'block', md: 'flex' }, ...
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
md: {
|
|
55
|
-
marginRight: 10,
|
|
56
|
-
},
|
|
57
|
-
}, children: [jsxRuntime.jsx(Avatar.default, { sx: { width: 40, height: 40, marginRight: 1, ...sxCreateCommentAvatarProps }, src: user?.avatar }), jsxRuntime.jsx(Box.default, { sx: { display: { xs: 'block', md: 'none' } }, children: jsxRuntime.jsx(Typography.default, { sx: {
|
|
58
|
-
fontSize: 14,
|
|
59
|
-
fontWeight: 700,
|
|
60
|
-
...sxCreateCommentNameTextProps,
|
|
61
|
-
}, mb: 1, children: user?.name }) })] })) : null, jsxRuntime.jsx(Box.default, { component: 'div', style: { width: '100%' }, children: jsxRuntime.jsx(ReactSimpleWysiwyg.ReactSimpleWysiwyg, { value: html, onChange: (value) => setHtml(value), ...createCommentContentProps }) }), jsxRuntime.jsx(ButtonDefault.ButtonDefault, { onClick: () => {
|
|
62
|
-
if (!canComment)
|
|
63
|
-
return comment_actions.openSubscriptionCommentsStoreAction(true);
|
|
64
|
-
callCreateComment({
|
|
65
|
-
data: {
|
|
66
|
-
message: html,
|
|
67
|
-
post_id: postId,
|
|
49
|
+
return (jsxRuntime.jsx(Card.default, { elevation: 0, children: jsxRuntime.jsxs(Box.default, { sx: { display: { xs: 'block', md: 'flex' }, ...sxCreateCommentContainerProps }, children: [user ? (jsxRuntime.jsx(Box.default, { sx: { ...sxCreateAvatarContainerProps }, children: jsxRuntime.jsxs(Box.default, { sx: {
|
|
50
|
+
xs: {
|
|
51
|
+
marginRight: 0,
|
|
52
|
+
marginBottom: 10,
|
|
53
|
+
display: 'flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
alignContent: 'center',
|
|
68
56
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
height: 40,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
57
|
+
md: {
|
|
58
|
+
marginRight: 10,
|
|
59
|
+
},
|
|
60
|
+
}, children: [jsxRuntime.jsx(Avatar.default, { sx: { width: 40, height: 40, marginRight: 1, ...sxCreateCommentAvatarProps }, src: user?.avatar }), jsxRuntime.jsx(Box.default, { sx: { display: { xs: 'block', md: 'none' } }, children: jsxRuntime.jsx(Typography.default, { sx: {
|
|
61
|
+
fontSize: 14,
|
|
62
|
+
fontWeight: 700,
|
|
63
|
+
...sxCreateCommentNameTextProps,
|
|
64
|
+
}, mb: 1, children: user?.name }) })] }) })) : null, jsxRuntime.jsx(Box.default, { component: 'div', sx: { width: '100%', ...sxCreateTextContainerProps }, children: jsxRuntime.jsx(ReactSimpleWysiwyg.ReactSimpleWysiwyg, { value: html, onChange: (value) => setHtml(value), ...createCommentContentProps }) }), jsxRuntime.jsx(Box.default, { sx: { ...sxCreateButtonContainerProps }, children: jsxRuntime.jsx(ButtonDefault.ButtonDefault, { onClick: () => {
|
|
65
|
+
if (!canComment)
|
|
66
|
+
return comment_actions.openSubscriptionCommentsStoreAction(true);
|
|
67
|
+
callCreateComment({
|
|
68
|
+
data: {
|
|
69
|
+
message: html,
|
|
70
|
+
post_id: postId,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}, color: !subscription ? 'primary' : 'inherit', isLoading: loading, sx: {
|
|
74
|
+
marginLeft: 10,
|
|
75
|
+
height: 40,
|
|
76
|
+
minWidth: 130,
|
|
77
|
+
'&:disabled': {
|
|
78
|
+
backgroundColor: '#8B8B8B !important',
|
|
79
|
+
},
|
|
80
|
+
...sxCreateCommentButtonProps,
|
|
81
|
+
}, children: "Comentar" }) })] }) }));
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
exports.CreateComment = CreateComment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateComment.js","sources":["../../../../../../src/components/comment/components/create-comment/CreateComment.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport {\n Avatar,\n AvatarProps,\n Box,\n BoxProps,\n ButtonProps,\n Card,\n Typography,\n TypographyProps,\n} from '@mui/material';\nimport { useComment } from '../../comment.hooks';\nimport {\n ReactSimpleWysiwyg,\n ReactSimpleWysiwygProps,\n} from '@/shared/components/react-editor/ReactSimpleWysiwyg';\nimport { useSession } from '@/components/session';\nimport { useCallAction } from '@cobuildlab/react-simple-state';\nimport { createComment, openSubscriptionCommentsStoreAction } from '../../comment.actions';\nimport { theme } from '@/shared/mui/theme';\nimport { ButtonDefault } from '@/shared/components/buttons/ButtonDefault';\n\nexport type CreateCommentProps = {\n createCommentAvatarProps?: AvatarProps;\n createCommentNameTextProps?: TypographyProps;\n
|
|
1
|
+
{"version":3,"file":"CreateComment.js","sources":["../../../../../../src/components/comment/components/create-comment/CreateComment.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport {\n Avatar,\n AvatarProps,\n Box,\n BoxProps,\n ButtonProps,\n Card,\n Typography,\n TypographyProps,\n} from '@mui/material';\nimport { useComment } from '../../comment.hooks';\nimport {\n ReactSimpleWysiwyg,\n ReactSimpleWysiwygProps,\n} from '@/shared/components/react-editor/ReactSimpleWysiwyg';\nimport { useSession } from '@/components/session';\nimport { useCallAction } from '@cobuildlab/react-simple-state';\nimport { createComment, openSubscriptionCommentsStoreAction } from '../../comment.actions';\nimport { theme } from '@/shared/mui/theme';\nimport { ButtonDefault } from '@/shared/components/buttons/ButtonDefault';\n\nexport type CreateCommentProps = {\n createCommentAvatarProps?: AvatarProps;\n createCommentNameTextProps?: TypographyProps;\n createCommentContainerProps?: BoxProps;\n\n createAvatarContainerProps?: BoxProps;\n createButtonContainerProps?: BoxProps;\n createTextContainerProps?: BoxProps;\n\n createCommentButtonProps?: ButtonProps;\n createCommentContentProps?: Omit<ReactSimpleWysiwygProps, 'value' | 'onChange'>;\n};\n\nexport const CreateComment: React.FC<CreateCommentProps> = ({\n createCommentAvatarProps = {},\n createAvatarContainerProps = {},\n createCommentNameTextProps = {},\n createCommentButtonProps = {},\n createCommentContentProps = {},\n createButtonContainerProps = {},\n createTextContainerProps = {},\n createCommentContainerProps = {},\n}) => {\n const { user, subscription } = useSession();\n const [html, setHtml] = useState<string>('');\n const { callAction, postId, onlyForRegistered, onlyForSubscribers } = useComment();\n\n const { sx: sxCreateCommentAvatarProps } = createCommentAvatarProps;\n const { sx: sxCreateCommentNameTextProps } = createCommentNameTextProps;\n const { sx: sxCreateCommentButtonProps } = createCommentButtonProps;\n\n const { sx: sxCreateButtonContainerProps } = createButtonContainerProps;\n const { sx: sxCreateAvatarContainerProps } = createAvatarContainerProps;\n const { sx: sxCreateTextContainerProps } = createTextContainerProps;\n const { sx: sxCreateCommentContainerProps } = createCommentContainerProps;\n\n const [callCreateComment, loading] = useCallAction(createComment, {\n onCompleted: () => {\n setHtml('');\n callAction();\n },\n });\n\n const canRegistered = onlyForRegistered && user;\n const canSubscriber = onlyForSubscribers && subscription;\n\n const canComment = canRegistered || canSubscriber;\n\n return (\n <Card elevation={0}>\n <Box sx={{ display: { xs: 'block', md: 'flex' }, ...sxCreateCommentContainerProps }}>\n {user ? (\n <Box sx={{ ...sxCreateAvatarContainerProps }}>\n <Box\n sx={{\n xs: {\n marginRight: 0,\n marginBottom: 10,\n display: 'flex',\n alignItems: 'center',\n alignContent: 'center',\n },\n md: {\n marginRight: 10,\n },\n }}>\n <Avatar\n sx={{ width: 40, height: 40, marginRight: 1, ...sxCreateCommentAvatarProps }}\n src={user?.avatar as string}\n />\n <Box sx={{ display: { xs: 'block', md: 'none' } }}>\n <Typography\n sx={{\n fontSize: 14,\n fontWeight: 700,\n ...sxCreateCommentNameTextProps,\n }}\n mb={1}>\n {user?.name}\n </Typography>\n </Box>\n </Box>\n </Box>\n ) : null}\n {\n <Box component={'div'} sx={{ width: '100%', ...sxCreateTextContainerProps }}>\n <ReactSimpleWysiwyg\n value={html}\n onChange={(value) => setHtml(value)}\n {...createCommentContentProps}\n />\n </Box>\n }\n {\n <Box sx={{ ...sxCreateButtonContainerProps }}>\n <ButtonDefault\n onClick={() => {\n if (!canComment) return openSubscriptionCommentsStoreAction(true);\n callCreateComment({\n data: {\n message: html,\n post_id: postId,\n },\n });\n }}\n color={!subscription ? 'primary' : 'inherit'}\n isLoading={loading}\n sx={{\n marginLeft: 10,\n height: 40,\n minWidth: 130,\n '&:disabled': {\n backgroundColor: '#8B8B8B !important',\n },\n ...sxCreateCommentButtonProps,\n }}>\n Comentar\n </ButtonDefault>\n </Box>\n }\n </Box>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO;;;AAYL;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;AAKI;;AAEH;AAED;AACA;AAEA;;AASc;AACE;AACA;AACA;AACA;AACA;AACD;AACD;AACE;AACD;;AASG;AACA;AACA;AACD;AAqBH;AAAiB;AACjB;AACE;AACE;AACA;AACD;AACF;AACH;AAIE;AACA;AACA;AACA;AACE;AACD;AACD;AACD;AAQf;;"}
|
|
@@ -24,14 +24,17 @@ import Box from '../../../../node_modules/@mui/material/esm/Box/Box.js';
|
|
|
24
24
|
import Avatar from '../../../../node_modules/@mui/material/esm/Avatar/Avatar.js';
|
|
25
25
|
import Typography from '../../../../node_modules/@mui/material/esm/Typography/Typography.js';
|
|
26
26
|
|
|
27
|
-
const CreateComment = ({ createCommentAvatarProps = {}, createCommentNameTextProps = {}, createCommentButtonProps = {}, createCommentContentProps = {},
|
|
27
|
+
const CreateComment = ({ createCommentAvatarProps = {}, createAvatarContainerProps = {}, createCommentNameTextProps = {}, createCommentButtonProps = {}, createCommentContentProps = {}, createButtonContainerProps = {}, createTextContainerProps = {}, createCommentContainerProps = {}, }) => {
|
|
28
28
|
const { user, subscription } = useSession();
|
|
29
29
|
const [html, setHtml] = useState('');
|
|
30
30
|
const { callAction, postId, onlyForRegistered, onlyForSubscribers } = useComment();
|
|
31
31
|
const { sx: sxCreateCommentAvatarProps } = createCommentAvatarProps;
|
|
32
32
|
const { sx: sxCreateCommentNameTextProps } = createCommentNameTextProps;
|
|
33
33
|
const { sx: sxCreateCommentButtonProps } = createCommentButtonProps;
|
|
34
|
-
const { sx:
|
|
34
|
+
const { sx: sxCreateButtonContainerProps } = createButtonContainerProps;
|
|
35
|
+
const { sx: sxCreateAvatarContainerProps } = createAvatarContainerProps;
|
|
36
|
+
const { sx: sxCreateTextContainerProps } = createTextContainerProps;
|
|
37
|
+
const { sx: sxCreateCommentContainerProps } = createCommentContainerProps;
|
|
35
38
|
const [callCreateComment, loading] = libExports.useCallAction(createComment, {
|
|
36
39
|
onCompleted: () => {
|
|
37
40
|
setHtml('');
|
|
@@ -41,39 +44,39 @@ const CreateComment = ({ createCommentAvatarProps = {}, createCommentNameTextPro
|
|
|
41
44
|
const canRegistered = onlyForRegistered && user;
|
|
42
45
|
const canSubscriber = onlyForSubscribers && subscription;
|
|
43
46
|
const canComment = canRegistered || canSubscriber;
|
|
44
|
-
return (jsx(Card, { elevation: 0, children: jsxs(Box, { sx: { display: { xs: 'block', md: 'flex' }, ...
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
md: {
|
|
53
|
-
marginRight: 10,
|
|
54
|
-
},
|
|
55
|
-
}, children: [jsx(Avatar, { sx: { width: 40, height: 40, marginRight: 1, ...sxCreateCommentAvatarProps }, src: user?.avatar }), jsx(Box, { sx: { display: { xs: 'block', md: 'none' } }, children: jsx(Typography, { sx: {
|
|
56
|
-
fontSize: 14,
|
|
57
|
-
fontWeight: 700,
|
|
58
|
-
...sxCreateCommentNameTextProps,
|
|
59
|
-
}, mb: 1, children: user?.name }) })] })) : null, jsx(Box, { component: 'div', style: { width: '100%' }, children: jsx(ReactSimpleWysiwyg, { value: html, onChange: (value) => setHtml(value), ...createCommentContentProps }) }), jsx(ButtonDefault, { onClick: () => {
|
|
60
|
-
if (!canComment)
|
|
61
|
-
return openSubscriptionCommentsStoreAction(true);
|
|
62
|
-
callCreateComment({
|
|
63
|
-
data: {
|
|
64
|
-
message: html,
|
|
65
|
-
post_id: postId,
|
|
47
|
+
return (jsx(Card, { elevation: 0, children: jsxs(Box, { sx: { display: { xs: 'block', md: 'flex' }, ...sxCreateCommentContainerProps }, children: [user ? (jsx(Box, { sx: { ...sxCreateAvatarContainerProps }, children: jsxs(Box, { sx: {
|
|
48
|
+
xs: {
|
|
49
|
+
marginRight: 0,
|
|
50
|
+
marginBottom: 10,
|
|
51
|
+
display: 'flex',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
alignContent: 'center',
|
|
66
54
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
height: 40,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
55
|
+
md: {
|
|
56
|
+
marginRight: 10,
|
|
57
|
+
},
|
|
58
|
+
}, children: [jsx(Avatar, { sx: { width: 40, height: 40, marginRight: 1, ...sxCreateCommentAvatarProps }, src: user?.avatar }), jsx(Box, { sx: { display: { xs: 'block', md: 'none' } }, children: jsx(Typography, { sx: {
|
|
59
|
+
fontSize: 14,
|
|
60
|
+
fontWeight: 700,
|
|
61
|
+
...sxCreateCommentNameTextProps,
|
|
62
|
+
}, mb: 1, children: user?.name }) })] }) })) : null, jsx(Box, { component: 'div', sx: { width: '100%', ...sxCreateTextContainerProps }, children: jsx(ReactSimpleWysiwyg, { value: html, onChange: (value) => setHtml(value), ...createCommentContentProps }) }), jsx(Box, { sx: { ...sxCreateButtonContainerProps }, children: jsx(ButtonDefault, { onClick: () => {
|
|
63
|
+
if (!canComment)
|
|
64
|
+
return openSubscriptionCommentsStoreAction(true);
|
|
65
|
+
callCreateComment({
|
|
66
|
+
data: {
|
|
67
|
+
message: html,
|
|
68
|
+
post_id: postId,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}, color: !subscription ? 'primary' : 'inherit', isLoading: loading, sx: {
|
|
72
|
+
marginLeft: 10,
|
|
73
|
+
height: 40,
|
|
74
|
+
minWidth: 130,
|
|
75
|
+
'&:disabled': {
|
|
76
|
+
backgroundColor: '#8B8B8B !important',
|
|
77
|
+
},
|
|
78
|
+
...sxCreateCommentButtonProps,
|
|
79
|
+
}, children: "Comentar" }) })] }) }));
|
|
77
80
|
};
|
|
78
81
|
|
|
79
82
|
export { CreateComment };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateComment.js","sources":["../../../../../../src/components/comment/components/create-comment/CreateComment.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport {\n Avatar,\n AvatarProps,\n Box,\n BoxProps,\n ButtonProps,\n Card,\n Typography,\n TypographyProps,\n} from '@mui/material';\nimport { useComment } from '../../comment.hooks';\nimport {\n ReactSimpleWysiwyg,\n ReactSimpleWysiwygProps,\n} from '@/shared/components/react-editor/ReactSimpleWysiwyg';\nimport { useSession } from '@/components/session';\nimport { useCallAction } from '@cobuildlab/react-simple-state';\nimport { createComment, openSubscriptionCommentsStoreAction } from '../../comment.actions';\nimport { theme } from '@/shared/mui/theme';\nimport { ButtonDefault } from '@/shared/components/buttons/ButtonDefault';\n\nexport type CreateCommentProps = {\n createCommentAvatarProps?: AvatarProps;\n createCommentNameTextProps?: TypographyProps;\n
|
|
1
|
+
{"version":3,"file":"CreateComment.js","sources":["../../../../../../src/components/comment/components/create-comment/CreateComment.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport {\n Avatar,\n AvatarProps,\n Box,\n BoxProps,\n ButtonProps,\n Card,\n Typography,\n TypographyProps,\n} from '@mui/material';\nimport { useComment } from '../../comment.hooks';\nimport {\n ReactSimpleWysiwyg,\n ReactSimpleWysiwygProps,\n} from '@/shared/components/react-editor/ReactSimpleWysiwyg';\nimport { useSession } from '@/components/session';\nimport { useCallAction } from '@cobuildlab/react-simple-state';\nimport { createComment, openSubscriptionCommentsStoreAction } from '../../comment.actions';\nimport { theme } from '@/shared/mui/theme';\nimport { ButtonDefault } from '@/shared/components/buttons/ButtonDefault';\n\nexport type CreateCommentProps = {\n createCommentAvatarProps?: AvatarProps;\n createCommentNameTextProps?: TypographyProps;\n createCommentContainerProps?: BoxProps;\n\n createAvatarContainerProps?: BoxProps;\n createButtonContainerProps?: BoxProps;\n createTextContainerProps?: BoxProps;\n\n createCommentButtonProps?: ButtonProps;\n createCommentContentProps?: Omit<ReactSimpleWysiwygProps, 'value' | 'onChange'>;\n};\n\nexport const CreateComment: React.FC<CreateCommentProps> = ({\n createCommentAvatarProps = {},\n createAvatarContainerProps = {},\n createCommentNameTextProps = {},\n createCommentButtonProps = {},\n createCommentContentProps = {},\n createButtonContainerProps = {},\n createTextContainerProps = {},\n createCommentContainerProps = {},\n}) => {\n const { user, subscription } = useSession();\n const [html, setHtml] = useState<string>('');\n const { callAction, postId, onlyForRegistered, onlyForSubscribers } = useComment();\n\n const { sx: sxCreateCommentAvatarProps } = createCommentAvatarProps;\n const { sx: sxCreateCommentNameTextProps } = createCommentNameTextProps;\n const { sx: sxCreateCommentButtonProps } = createCommentButtonProps;\n\n const { sx: sxCreateButtonContainerProps } = createButtonContainerProps;\n const { sx: sxCreateAvatarContainerProps } = createAvatarContainerProps;\n const { sx: sxCreateTextContainerProps } = createTextContainerProps;\n const { sx: sxCreateCommentContainerProps } = createCommentContainerProps;\n\n const [callCreateComment, loading] = useCallAction(createComment, {\n onCompleted: () => {\n setHtml('');\n callAction();\n },\n });\n\n const canRegistered = onlyForRegistered && user;\n const canSubscriber = onlyForSubscribers && subscription;\n\n const canComment = canRegistered || canSubscriber;\n\n return (\n <Card elevation={0}>\n <Box sx={{ display: { xs: 'block', md: 'flex' }, ...sxCreateCommentContainerProps }}>\n {user ? (\n <Box sx={{ ...sxCreateAvatarContainerProps }}>\n <Box\n sx={{\n xs: {\n marginRight: 0,\n marginBottom: 10,\n display: 'flex',\n alignItems: 'center',\n alignContent: 'center',\n },\n md: {\n marginRight: 10,\n },\n }}>\n <Avatar\n sx={{ width: 40, height: 40, marginRight: 1, ...sxCreateCommentAvatarProps }}\n src={user?.avatar as string}\n />\n <Box sx={{ display: { xs: 'block', md: 'none' } }}>\n <Typography\n sx={{\n fontSize: 14,\n fontWeight: 700,\n ...sxCreateCommentNameTextProps,\n }}\n mb={1}>\n {user?.name}\n </Typography>\n </Box>\n </Box>\n </Box>\n ) : null}\n {\n <Box component={'div'} sx={{ width: '100%', ...sxCreateTextContainerProps }}>\n <ReactSimpleWysiwyg\n value={html}\n onChange={(value) => setHtml(value)}\n {...createCommentContentProps}\n />\n </Box>\n }\n {\n <Box sx={{ ...sxCreateButtonContainerProps }}>\n <ButtonDefault\n onClick={() => {\n if (!canComment) return openSubscriptionCommentsStoreAction(true);\n callCreateComment({\n data: {\n message: html,\n post_id: postId,\n },\n });\n }}\n color={!subscription ? 'primary' : 'inherit'}\n isLoading={loading}\n sx={{\n marginLeft: 10,\n height: 40,\n minWidth: 130,\n '&:disabled': {\n backgroundColor: '#8B8B8B !important',\n },\n ...sxCreateCommentButtonProps,\n }}>\n Comentar\n </ButtonDefault>\n </Box>\n }\n </Box>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO;;;AAYL;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;AAKI;;AAEH;AAED;AACA;AAEA;;AASc;AACE;AACA;AACA;AACA;AACA;AACD;AACD;AACE;AACD;;AASG;AACA;AACA;AACD;AAqBH;AAAiB;AACjB;AACE;AACE;AACA;AACD;AACF;AACH;AAIE;AACA;AACA;AACA;AACE;AACD;AACD;AACD;AAQf;;"}
|
|
@@ -4,7 +4,10 @@ import { ReactSimpleWysiwygProps } from '@/shared/components/react-editor/ReactS
|
|
|
4
4
|
export type CreateCommentProps = {
|
|
5
5
|
createCommentAvatarProps?: AvatarProps;
|
|
6
6
|
createCommentNameTextProps?: TypographyProps;
|
|
7
|
-
|
|
7
|
+
createCommentContainerProps?: BoxProps;
|
|
8
|
+
createAvatarContainerProps?: BoxProps;
|
|
9
|
+
createButtonContainerProps?: BoxProps;
|
|
10
|
+
createTextContainerProps?: BoxProps;
|
|
8
11
|
createCommentButtonProps?: ButtonProps;
|
|
9
12
|
createCommentContentProps?: Omit<ReactSimpleWysiwygProps, 'value' | 'onChange'>;
|
|
10
13
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -174,7 +174,10 @@ declare const Paywall: React__default.FC<PaywallProps>;
|
|
|
174
174
|
type CreateCommentProps = {
|
|
175
175
|
createCommentAvatarProps?: AvatarProps;
|
|
176
176
|
createCommentNameTextProps?: TypographyProps;
|
|
177
|
-
|
|
177
|
+
createCommentContainerProps?: BoxProps;
|
|
178
|
+
createAvatarContainerProps?: BoxProps;
|
|
179
|
+
createButtonContainerProps?: BoxProps;
|
|
180
|
+
createTextContainerProps?: BoxProps;
|
|
178
181
|
createCommentButtonProps?: ButtonProps;
|
|
179
182
|
createCommentContentProps?: Omit<ReactSimpleWysiwygProps, 'value' | 'onChange'>;
|
|
180
183
|
};
|