react-easy-wall 2.0.11 → 2.0.13
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/_virtual/index.cjs +3 -3
- package/dist/cjs/_virtual/index10.cjs +2 -2
- package/dist/cjs/_virtual/index11.cjs +2 -2
- package/dist/cjs/_virtual/index2.cjs +2 -8
- package/dist/cjs/_virtual/index2.cjs.map +1 -1
- package/dist/cjs/_virtual/index3.cjs +2 -2
- package/dist/cjs/_virtual/index4.cjs +2 -8
- package/dist/cjs/_virtual/index4.cjs.map +1 -1
- package/dist/cjs/_virtual/index5.cjs +2 -8
- package/dist/cjs/_virtual/index5.cjs.map +1 -1
- package/dist/cjs/_virtual/index6.cjs +2 -2
- package/dist/cjs/_virtual/index7.cjs +2 -4
- package/dist/cjs/_virtual/index7.cjs.map +1 -1
- package/dist/cjs/_virtual/index8.cjs +2 -2
- package/dist/cjs/_virtual/index9.cjs +2 -2
- package/dist/cjs/components/comment/CommentProvider.cjs +3 -3
- package/dist/cjs/components/comment/Comments.cjs +7 -8
- package/dist/cjs/components/comment/Comments.cjs.map +1 -1
- package/dist/cjs/components/comment/comment.actions.cjs +8 -8
- package/dist/cjs/components/comment/comment.events.cjs +7 -7
- package/dist/cjs/components/comment/comment.store.cjs +5 -5
- package/dist/cjs/components/comment/comment.utils.cjs +3 -1
- package/dist/cjs/components/comment/comment.utils.cjs.map +1 -1
- package/dist/cjs/components/comment/components/AddComment.cjs +6 -9
- package/dist/cjs/components/comment/components/AddComment.cjs.map +1 -1
- package/dist/cjs/components/comment/components/AddCommentContainer.cjs +4 -8
- package/dist/cjs/components/comment/components/AddCommentContainer.cjs.map +1 -1
- package/dist/cjs/components/comment/components/AddReplyComment.cjs +8 -11
- package/dist/cjs/components/comment/components/AddReplyComment.cjs.map +1 -1
- package/dist/cjs/components/comment/components/AddReplyCommentContainer.cjs +4 -7
- package/dist/cjs/components/comment/components/AddReplyCommentContainer.cjs.map +1 -1
- package/dist/cjs/components/comment/components/CommentContainer.cjs +4 -6
- package/dist/cjs/components/comment/components/CommentContainer.cjs.map +1 -1
- package/dist/cjs/components/comment/components/CommentItem.cjs +5 -10
- package/dist/cjs/components/comment/components/CommentItem.cjs.map +1 -1
- package/dist/cjs/components/comment/components/CommentSubscriptionDialog.cjs +5 -6
- package/dist/cjs/components/comment/components/CommentSubscriptionDialog.cjs.map +1 -1
- package/dist/cjs/components/comment/components/ReplyComments.cjs +2 -2
- package/dist/cjs/components/comment/components/ReplyComments.cjs.map +1 -1
- package/dist/cjs/components/comment/components/ShowMoreComments.cjs +6 -8
- package/dist/cjs/components/comment/components/ShowMoreComments.cjs.map +1 -1
- package/dist/cjs/components/panel/Panel.cjs +4 -5
- package/dist/cjs/components/panel/Panel.cjs.map +1 -1
- package/dist/cjs/components/panel/PanelAvatar.cjs +2 -5
- package/dist/cjs/components/panel/PanelAvatar.cjs.map +1 -1
- package/dist/cjs/components/panel/PanelButton.cjs +7 -7
- package/dist/cjs/components/panel/PanelButton.cjs.map +1 -1
- package/dist/cjs/components/panel/PanelDivider.cjs +2 -2
- package/dist/cjs/components/panel/PanelDivider.cjs.map +1 -1
- package/dist/cjs/components/panel/PanelFooter.cjs +3 -4
- package/dist/cjs/components/panel/PanelFooter.cjs.map +1 -1
- package/dist/cjs/components/panel/PanelHeader.cjs +2 -2
- package/dist/cjs/components/panel/PanelHeader.cjs.map +1 -1
- package/dist/cjs/components/panel/PanelItem.cjs +2 -5
- package/dist/cjs/components/panel/PanelItem.cjs.map +1 -1
- package/dist/cjs/components/panel/PanelListItems.cjs +2 -4
- package/dist/cjs/components/panel/PanelListItems.cjs.map +1 -1
- package/dist/cjs/components/panel/PanelSubscriptionIcon.cjs +2 -2
- package/dist/cjs/components/panel/PanelSubscriptionIcon.cjs.map +1 -1
- package/dist/cjs/components/panel/panel.actions.cjs +4 -4
- package/dist/cjs/components/panel/panel.actions.cjs.map +1 -1
- package/dist/cjs/components/panel/panel.store.cjs +2 -2
- package/dist/cjs/components/paywall/PaywallRegister.cjs +6 -8
- package/dist/cjs/components/paywall/PaywallRegister.cjs.map +1 -1
- package/dist/cjs/components/paywall/PaywallSubscription.cjs +6 -8
- package/dist/cjs/components/paywall/PaywallSubscription.cjs.map +1 -1
- package/dist/cjs/components/session/SessionClientProvider.cjs +2 -2
- package/dist/cjs/components/session/SessionClientProvider.cjs.map +1 -1
- package/dist/cjs/components/session/SessionUserClientProvider.cjs +10 -10
- package/dist/cjs/components/session/SessionUserClientProvider.cjs.map +1 -1
- package/dist/cjs/components/session/session.actions.cjs +9 -10
- package/dist/cjs/components/session/session.actions.cjs.map +1 -1
- package/dist/cjs/components/session/session.constants.cjs +2 -2
- package/dist/cjs/components/session/session.constants.cjs.map +1 -1
- package/dist/cjs/components/session/session.events.cjs +13 -13
- package/dist/cjs/components/session/session.events.cjs.map +1 -1
- package/dist/cjs/components/session/session.stores.cjs +2 -2
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/caches.cjs +0 -31
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/caches.cjs.map +1 -1
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/checkDocument.cjs +3 -4
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/checkDocument.cjs.map +1 -1
- package/dist/cjs/node_modules/@cobuildlab/react-simple-state/lib/index.cjs +1 -1
- package/dist/cjs/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.cjs +446 -0
- package/dist/cjs/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.cjs.map +1 -0
- package/dist/cjs/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.cjs +130 -0
- package/dist/cjs/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.cjs.map +1 -0
- package/dist/cjs/node_modules/@emotion/react/dist/emotion-react.browser.esm.cjs +127 -0
- package/dist/cjs/node_modules/@emotion/react/dist/emotion-react.browser.esm.cjs.map +1 -0
- package/dist/cjs/node_modules/@emotion/serialize/dist/emotion-serialize.esm.cjs +3 -20
- package/dist/cjs/node_modules/@emotion/serialize/dist/emotion-serialize.esm.cjs.map +1 -1
- package/dist/cjs/node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.cjs +190 -0
- package/dist/cjs/node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.cjs.map +1 -0
- package/dist/cjs/node_modules/@emotion/styled/dist/emotion-styled.browser.esm.cjs +18 -0
- package/dist/cjs/node_modules/@emotion/styled/dist/emotion-styled.browser.esm.cjs.map +1 -0
- package/dist/cjs/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.cjs +34 -0
- package/dist/cjs/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.cjs.map +1 -0
- package/dist/cjs/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.cjs +50 -0
- package/dist/cjs/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.cjs.map +1 -0
- package/dist/cjs/node_modules/@mui/material/esm/zero-styled/index.cjs +0 -7
- package/dist/cjs/node_modules/@mui/material/esm/zero-styled/index.cjs.map +1 -1
- package/dist/cjs/node_modules/@mui/styled-engine/esm/GlobalStyles/GlobalStyles.cjs +2 -2
- package/dist/cjs/node_modules/@mui/styled-engine/esm/GlobalStyles/GlobalStyles.cjs.map +1 -1
- package/dist/cjs/node_modules/@mui/styled-engine/esm/index.cjs +15 -2
- package/dist/cjs/node_modules/@mui/styled-engine/esm/index.cjs.map +1 -1
- package/dist/cjs/node_modules/@mui/styles/node_modules/@mui/utils/esm/deepmerge/deepmerge.cjs +1 -1
- package/dist/cjs/node_modules/@mui/system/esm/RtlProvider/index.cjs +0 -5
- package/dist/cjs/node_modules/@mui/system/esm/RtlProvider/index.cjs.map +1 -1
- package/dist/cjs/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.cjs +2 -2
- package/dist/cjs/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.cjs.map +1 -1
- package/dist/cjs/node_modules/@mui/system/esm/useThemeWithoutDefault/useThemeWithoutDefault.cjs +2 -2
- package/dist/cjs/node_modules/@mui/system/esm/useThemeWithoutDefault/useThemeWithoutDefault.cjs.map +1 -1
- package/dist/cjs/node_modules/@mui/utils/esm/deepmerge/deepmerge.cjs +1 -1
- package/dist/cjs/node_modules/@mui/utils/esm/useId/useId.cjs +1 -1
- package/dist/cjs/node_modules/@mui/utils/esm/useId/useId.cjs.map +1 -1
- package/dist/cjs/node_modules/graphql/language/ast.cjs +0 -104
- package/dist/cjs/node_modules/graphql/language/ast.cjs.map +1 -1
- package/dist/cjs/node_modules/hoist-non-react-statics/node_modules/react-is/index.cjs +1 -1
- package/dist/cjs/node_modules/next/dist/client/script.cjs +2 -2
- package/dist/cjs/node_modules/next/dist/client/script.cjs.map +1 -1
- package/dist/cjs/node_modules/next/dist/compiled/cookie/index.cjs +1 -1
- package/dist/cjs/node_modules/next/dist/compiled/gzip-size/index.cjs +5 -5
- package/dist/cjs/node_modules/next/dist/compiled/gzip-size/index.cjs.map +1 -1
- package/dist/cjs/node_modules/next/dist/compiled/path-to-regexp/index.cjs +1 -1
- package/dist/cjs/node_modules/next/dist/shared/lib/router/utils/index.cjs +1 -1
- package/dist/cjs/node_modules/prop-types/index.cjs +1 -1
- package/dist/cjs/node_modules/react-giphy-searchbox/es/index.cjs +1 -1
- package/dist/cjs/node_modules/react-is/index.cjs +1 -1
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscription.cjs +1 -2
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscription.cjs.map +1 -1
- package/dist/cjs/node_modules/tslib/tslib.es6.cjs +0 -79
- package/dist/cjs/node_modules/tslib/tslib.es6.cjs.map +1 -1
- package/dist/cjs/shared/apollo/apollo.client.cjs +4 -6
- package/dist/cjs/shared/apollo/apollo.client.cjs.map +1 -1
- package/dist/cjs/shared/components/buttons/ButtonDefault.cjs +3 -5
- package/dist/cjs/shared/components/buttons/ButtonDefault.cjs.map +1 -1
- package/dist/cjs/shared/components/dialog/DialogDefault.cjs +4 -8
- package/dist/cjs/shared/components/dialog/DialogDefault.cjs.map +1 -1
- package/dist/cjs/shared/components/react-editor/BtnEmoji.cjs +5 -6
- package/dist/cjs/shared/components/react-editor/BtnEmoji.cjs.map +1 -1
- package/dist/cjs/shared/components/react-editor/BtnGif.cjs +6 -8
- package/dist/cjs/shared/components/react-editor/BtnGif.cjs.map +1 -1
- package/dist/cjs/shared/components/react-editor/ReactSimpleWysiwyg.cjs +6 -6
- package/dist/cjs/shared/components/react-editor/ReactSimpleWysiwyg.cjs.map +1 -1
- package/dist/cjs/shared/cookies/cookies.utils.cjs +2 -2
- package/dist/cjs/shared/cookies/cookies.utils.cjs.map +1 -1
- package/dist/cjs/shared/cookies/index.cjs +2 -2
- package/dist/cjs/shared/cookies/index.cjs.map +1 -1
- package/dist/cjs/shared/types/generated.cjs +7 -7
- package/dist/cjs/shared/types/generated.cjs.map +1 -1
- package/dist/esm/_virtual/index.js +3 -3
- package/dist/esm/_virtual/index10.js +2 -2
- package/dist/esm/_virtual/index11.js +2 -2
- package/dist/esm/_virtual/index2.js +2 -6
- package/dist/esm/_virtual/index2.js.map +1 -1
- package/dist/esm/_virtual/index3.js +2 -2
- package/dist/esm/_virtual/index4.js +2 -6
- package/dist/esm/_virtual/index4.js.map +1 -1
- package/dist/esm/_virtual/index5.js +2 -6
- package/dist/esm/_virtual/index5.js.map +1 -1
- package/dist/esm/_virtual/index6.js +2 -2
- package/dist/esm/_virtual/index7.js +2 -4
- package/dist/esm/_virtual/index7.js.map +1 -1
- package/dist/esm/_virtual/index8.js +2 -2
- package/dist/esm/_virtual/index9.js +2 -2
- package/dist/esm/components/comment/CommentProvider.js +3 -3
- package/dist/esm/components/comment/CommentProvider.js.map +1 -1
- package/dist/esm/components/comment/Comments.js +4 -5
- package/dist/esm/components/comment/Comments.js.map +1 -1
- package/dist/esm/components/comment/comment.actions.js +8 -8
- package/dist/esm/components/comment/comment.actions.js.map +1 -1
- package/dist/esm/components/comment/comment.events.js +7 -7
- package/dist/esm/components/comment/comment.events.js.map +1 -1
- package/dist/esm/components/comment/comment.store.js +5 -5
- package/dist/esm/components/comment/comment.store.js.map +1 -1
- package/dist/esm/components/comment/comment.utils.js +3 -1
- package/dist/esm/components/comment/comment.utils.js.map +1 -1
- package/dist/esm/components/comment/components/AddComment.js +4 -7
- package/dist/esm/components/comment/components/AddComment.js.map +1 -1
- package/dist/esm/components/comment/components/AddCommentContainer.js +2 -6
- package/dist/esm/components/comment/components/AddCommentContainer.js.map +1 -1
- package/dist/esm/components/comment/components/AddReplyComment.js +6 -9
- package/dist/esm/components/comment/components/AddReplyComment.js.map +1 -1
- package/dist/esm/components/comment/components/AddReplyCommentContainer.js +2 -5
- package/dist/esm/components/comment/components/AddReplyCommentContainer.js.map +1 -1
- package/dist/esm/components/comment/components/CommentContainer.js +3 -5
- package/dist/esm/components/comment/components/CommentContainer.js.map +1 -1
- package/dist/esm/components/comment/components/CommentItem.js +2 -7
- package/dist/esm/components/comment/components/CommentItem.js.map +1 -1
- package/dist/esm/components/comment/components/CommentSubscriptionDialog.js +3 -4
- package/dist/esm/components/comment/components/CommentSubscriptionDialog.js.map +1 -1
- package/dist/esm/components/comment/components/ReplyComments.js +1 -1
- package/dist/esm/components/comment/components/ShowMoreComments.js +4 -6
- package/dist/esm/components/comment/components/ShowMoreComments.js.map +1 -1
- package/dist/esm/components/panel/Panel.js +3 -4
- package/dist/esm/components/panel/Panel.js.map +1 -1
- package/dist/esm/components/panel/PanelAvatar.js +1 -4
- package/dist/esm/components/panel/PanelAvatar.js.map +1 -1
- package/dist/esm/components/panel/PanelButton.js +3 -3
- package/dist/esm/components/panel/PanelButton.js.map +1 -1
- package/dist/esm/components/panel/PanelDivider.js +1 -1
- package/dist/esm/components/panel/PanelFooter.js +1 -2
- package/dist/esm/components/panel/PanelFooter.js.map +1 -1
- package/dist/esm/components/panel/PanelHeader.js +1 -1
- package/dist/esm/components/panel/PanelItem.js +1 -4
- package/dist/esm/components/panel/PanelItem.js.map +1 -1
- package/dist/esm/components/panel/PanelListItems.js +1 -3
- package/dist/esm/components/panel/PanelListItems.js.map +1 -1
- package/dist/esm/components/panel/PanelSubscriptionIcon.js +1 -1
- package/dist/esm/components/panel/panel.actions.js +2 -2
- package/dist/esm/components/panel/panel.actions.js.map +1 -1
- package/dist/esm/components/panel/panel.store.js +2 -2
- package/dist/esm/components/panel/panel.store.js.map +1 -1
- package/dist/esm/components/paywall/PaywallRegister.js +1 -3
- package/dist/esm/components/paywall/PaywallRegister.js.map +1 -1
- package/dist/esm/components/paywall/PaywallSubscription.js +1 -3
- package/dist/esm/components/paywall/PaywallSubscription.js.map +1 -1
- package/dist/esm/components/session/SessionClientProvider.js +1 -1
- package/dist/esm/components/session/SessionUserClientProvider.js +5 -5
- package/dist/esm/components/session/SessionUserClientProvider.js.map +1 -1
- package/dist/esm/components/session/session.actions.js +6 -7
- package/dist/esm/components/session/session.actions.js.map +1 -1
- package/dist/esm/components/session/session.constants.js +1 -1
- package/dist/esm/components/session/session.events.js +10 -10
- package/dist/esm/components/session/session.events.js.map +1 -1
- package/dist/esm/components/session/session.stores.js +2 -2
- package/dist/esm/components/session/session.stores.js.map +1 -1
- package/dist/esm/node_modules/@apollo/client/utilities/internal/caches.js +1 -31
- package/dist/esm/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
- package/dist/esm/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
- package/dist/esm/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
- package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/index.js +1 -1
- package/dist/esm/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js +4 -4
- package/dist/esm/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js +2 -2
- package/dist/esm/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js.map +1 -1
- package/dist/esm/node_modules/@emotion/react/dist/emotion-react.browser.esm.js +1 -24
- package/dist/esm/node_modules/@emotion/react/dist/emotion-react.browser.esm.js.map +1 -1
- package/dist/esm/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js +3 -20
- package/dist/esm/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js.map +1 -1
- package/dist/esm/node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js +0 -1
- package/dist/esm/node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js.map +1 -1
- package/dist/esm/node_modules/@mui/material/esm/zero-styled/index.js +1 -7
- package/dist/esm/node_modules/@mui/material/esm/zero-styled/index.js.map +1 -1
- package/dist/esm/node_modules/@mui/styled-engine/esm/GlobalStyles/GlobalStyles.js +1 -1
- package/dist/esm/node_modules/@mui/styled-engine/esm/index.js +3 -2
- package/dist/esm/node_modules/@mui/styled-engine/esm/index.js.map +1 -1
- package/dist/esm/node_modules/@mui/styles/node_modules/@mui/utils/esm/deepmerge/deepmerge.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/RtlProvider/index.js +1 -5
- package/dist/esm/node_modules/@mui/system/esm/RtlProvider/index.js.map +1 -1
- package/dist/esm/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/useThemeWithoutDefault/useThemeWithoutDefault.js +1 -1
- package/dist/esm/node_modules/@mui/utils/esm/deepmerge/deepmerge.js +1 -1
- package/dist/esm/node_modules/@mui/utils/esm/useId/useId.js +1 -1
- package/dist/esm/node_modules/@mui/utils/esm/useId/useId.js.map +1 -1
- package/dist/esm/node_modules/graphql/language/ast.js +1 -103
- package/dist/esm/node_modules/graphql/language/ast.js.map +1 -1
- package/dist/esm/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/esm/node_modules/next/dist/client/script.js +2 -2
- package/dist/esm/node_modules/next/dist/client/script.js.map +1 -1
- package/dist/esm/node_modules/next/dist/compiled/cookie/index.js +1 -1
- package/dist/esm/node_modules/next/dist/compiled/gzip-size/index.js +5 -5
- package/dist/esm/node_modules/next/dist/compiled/gzip-size/index.js.map +1 -1
- package/dist/esm/node_modules/next/dist/compiled/path-to-regexp/index.js +1 -1
- package/dist/esm/node_modules/next/dist/shared/lib/router/utils/index.js +1 -1
- package/dist/esm/node_modules/prop-types/index.js +1 -1
- package/dist/esm/node_modules/react-giphy-searchbox/es/index.js +1 -1
- package/dist/esm/node_modules/react-is/index.js +1 -1
- package/dist/esm/node_modules/rxjs/dist/esm5/internal/Subscriber.js +1 -1
- package/dist/esm/node_modules/rxjs/dist/esm5/internal/Subscription.js +2 -2
- package/dist/esm/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
- package/dist/esm/node_modules/stylis/src/Parser.js +1 -1
- package/dist/esm/node_modules/stylis/src/Tokenizer.js +1 -1
- package/dist/esm/node_modules/tslib/tslib.es6.js +1 -75
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/esm/shared/apollo/apollo.client.js +1 -3
- package/dist/esm/shared/apollo/apollo.client.js.map +1 -1
- package/dist/esm/shared/components/buttons/ButtonDefault.js +1 -3
- package/dist/esm/shared/components/buttons/ButtonDefault.js.map +1 -1
- package/dist/esm/shared/components/dialog/DialogDefault.js +2 -6
- package/dist/esm/shared/components/dialog/DialogDefault.js.map +1 -1
- package/dist/esm/shared/components/react-editor/BtnEmoji.js +4 -5
- package/dist/esm/shared/components/react-editor/BtnEmoji.js.map +1 -1
- package/dist/esm/shared/components/react-editor/BtnGif.js +3 -5
- package/dist/esm/shared/components/react-editor/BtnGif.js.map +1 -1
- package/dist/esm/shared/components/react-editor/ReactSimpleWysiwyg.js +3 -3
- package/dist/esm/shared/cookies/cookies.utils.js +1 -1
- package/dist/esm/shared/cookies/index.js +1 -1
- package/dist/esm/shared/types/generated.js +1 -1
- package/package.json +1 -1
|
@@ -2,16 +2,15 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { AddCommentContainer } from './components/AddCommentContainer.js';
|
|
4
4
|
import { useSession } from '../session/session.hooks.js';
|
|
5
|
-
import {
|
|
5
|
+
import { Box, Grid } from '@mui/material';
|
|
6
|
+
import { useStore } from '@cobuildlab/react-simple-state';
|
|
6
7
|
import { fetchCommentsStore } from './comment.store.js';
|
|
7
8
|
import { useComment } from './comment.hooks.js';
|
|
8
9
|
import { ShowMoreComments } from './components/ShowMoreComments.js';
|
|
9
10
|
import { CommentContainer } from './components/CommentContainer.js';
|
|
10
11
|
import { ButtonDefault } from '../../shared/components/buttons/ButtonDefault.js';
|
|
12
|
+
import { makeStyles } from '@mui/styles';
|
|
11
13
|
import { CommentSubscriptionDialog } from './components/CommentSubscriptionDialog.js';
|
|
12
|
-
import makeStyles from '../../node_modules/@mui/styles/makeStyles/makeStyles.js';
|
|
13
|
-
import Box from '../../node_modules/@mui/material/esm/Box/Box.js';
|
|
14
|
-
import Grid from '../../node_modules/@mui/material/esm/Grid/Grid.js';
|
|
15
14
|
|
|
16
15
|
const useStyles = makeStyles({
|
|
17
16
|
button: {
|
|
@@ -24,7 +23,7 @@ const useStyles = makeStyles({
|
|
|
24
23
|
});
|
|
25
24
|
const Comments = () => {
|
|
26
25
|
const { user } = useSession();
|
|
27
|
-
const { comments } =
|
|
26
|
+
const { comments } = useStore(fetchCommentsStore);
|
|
28
27
|
const classes = useStyles();
|
|
29
28
|
const [showComments, setShowComments] = useState(true);
|
|
30
29
|
const commentsAll = useComment();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Comments.js","sources":["../../../../src/components/comment/Comments.tsx"],"sourcesContent":["\n\n\nimport React, { useState } from 'react';\nimport { AddCommentContainer } from './components/AddCommentContainer';\nimport { useSession } from '../session/session.hooks';\nimport { Grid, Box } from '@mui/material';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { fetchCommentsStore } from './comment.store';\nimport { useComment } from './comment.hooks';\nimport { ShowMoreComments } from './components/ShowMoreComments';\nimport { CommentContainer } from './components/CommentContainer';\nimport { ButtonDefault } from '../../shared/components/buttons/ButtonDefault';\nimport { makeStyles } from '@mui/styles';\nimport { CommentSubscriptionDialog } from './components/CommentSubscriptionDialog';\n\nconst useStyles = makeStyles({\n button: {\n borderRadius: 8,\n width: 280,\n height: 50,\n fontSize: 16,\n fontWeight: 700,\n },\n});\nexport const Comments: React.FC = () => {\n const { user } = useSession();\n const { comments } = useStore(fetchCommentsStore);\n const classes = useStyles();\n const [showComments, setShowComments] = useState(true);\n\n const commentsAll = useComment();\n\n if (!user && commentsAll.loading) return <div>Loading...</div>;\n return (\n <Box mt={2}>\n <Grid container>\n <Grid size={12} display=\"flex\" justifyContent=\"center\">\n <ButtonDefault\n className={classes.button}\n onClick={() => {\n return setShowComments(!showComments);\n }}>\n {showComments ? 'Ocultar comentarios' : 'Comentarios'}\n </ButtonDefault>\n </Grid>\n {showComments ? (\n <Grid size={12}>\n <Grid container>\n <Grid size={12} mb={2}>\n <AddCommentContainer />\n </Grid>\n {comments.map((comment, key) => (\n <Grid size={12} key={key}>\n <CommentContainer comment={comment} />\n </Grid>\n ))}\n <ShowMoreComments />\n </Grid>\n </Grid>\n ) : null}\n </Grid>\n <CommentSubscriptionDialog />\n </Box>\n );\n};\n"],"names":["
|
|
1
|
+
{"version":3,"file":"Comments.js","sources":["../../../../src/components/comment/Comments.tsx"],"sourcesContent":["\n\n\nimport React, { useState } from 'react';\nimport { AddCommentContainer } from './components/AddCommentContainer';\nimport { useSession } from '../session/session.hooks';\nimport { Grid, Box } from '@mui/material';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { fetchCommentsStore } from './comment.store';\nimport { useComment } from './comment.hooks';\nimport { ShowMoreComments } from './components/ShowMoreComments';\nimport { CommentContainer } from './components/CommentContainer';\nimport { ButtonDefault } from '../../shared/components/buttons/ButtonDefault';\nimport { makeStyles } from '@mui/styles';\nimport { CommentSubscriptionDialog } from './components/CommentSubscriptionDialog';\n\nconst useStyles = makeStyles({\n button: {\n borderRadius: 8,\n width: 280,\n height: 50,\n fontSize: 16,\n fontWeight: 700,\n },\n});\nexport const Comments: React.FC = () => {\n const { user } = useSession();\n const { comments } = useStore(fetchCommentsStore);\n const classes = useStyles();\n const [showComments, setShowComments] = useState(true);\n\n const commentsAll = useComment();\n\n if (!user && commentsAll.loading) return <div>Loading...</div>;\n return (\n <Box mt={2}>\n <Grid container>\n <Grid size={12} display=\"flex\" justifyContent=\"center\">\n <ButtonDefault\n className={classes.button}\n onClick={() => {\n return setShowComments(!showComments);\n }}>\n {showComments ? 'Ocultar comentarios' : 'Comentarios'}\n </ButtonDefault>\n </Grid>\n {showComments ? (\n <Grid size={12}>\n <Grid container>\n <Grid size={12} mb={2}>\n <AddCommentContainer />\n </Grid>\n {comments.map((comment, key) => (\n <Grid size={12} key={key}>\n <CommentContainer comment={comment} />\n </Grid>\n ))}\n <ShowMoreComments />\n </Grid>\n </Grid>\n ) : null}\n </Grid>\n <CommentSubscriptionDialog />\n </Box>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAM,SAAS,GAAG,UAAU,CAAC;AAC3B,IAAA,MAAM,EAAE;AACN,QAAA,YAAY,EAAE,CAAC;AACf,QAAA,KAAK,EAAE,GAAG;AACV,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,UAAU,EAAE,GAAG;AAChB,KAAA;AACF,CAAA,CAAC;AACK,MAAM,QAAQ,GAAa,MAAK;AACrC,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE;IAC7B,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,kBAAkB,CAAC;AACjD,IAAA,MAAM,OAAO,GAAG,SAAS,EAAE;IAC3B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;AAEtD,IAAA,MAAM,WAAW,GAAG,UAAU,EAAE;AAEhC,IAAA,IAAI,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|
|
1
|
+
import { createStoreAction, createAction } from '@cobuildlab/react-simple-state';
|
|
2
2
|
import { fetchCommentsStore, postStore, replyCommentStore, openSubscriptionCommentsStore } from './comment.store.js';
|
|
3
3
|
import { CommentsDocument, CreateCommentDocument, CreateReplyCommentDocument } from '../../shared/types/generated.js';
|
|
4
4
|
import { fetchCommentsEvent, fetchCommentErrorEvent, createCommentEvent, createCommentErrorEvent, createReplyCommentEvent, createReplyCommentErrorEvent } from './comment.events.js';
|
|
5
5
|
import { apolloClient } from '../../shared/apollo/apollo.client.js';
|
|
6
6
|
|
|
7
7
|
const client = apolloClient();
|
|
8
|
-
const fetchCommentsStoreAction =
|
|
8
|
+
const fetchCommentsStoreAction = createStoreAction(fetchCommentsStore, (prev, comments, count) => ({
|
|
9
9
|
...prev,
|
|
10
10
|
comments,
|
|
11
11
|
count,
|
|
12
12
|
}));
|
|
13
|
-
|
|
13
|
+
createStoreAction(postStore, (prev, id) => ({
|
|
14
14
|
...prev,
|
|
15
15
|
id,
|
|
16
16
|
}));
|
|
17
|
-
const replyCommentStoreAction =
|
|
17
|
+
const replyCommentStoreAction = createStoreAction(replyCommentStore, (prev, message, commentId) => ({
|
|
18
18
|
...prev,
|
|
19
19
|
message,
|
|
20
20
|
commentId,
|
|
21
21
|
}));
|
|
22
|
-
const fetchComments =
|
|
22
|
+
const fetchComments = createAction(fetchCommentsEvent, fetchCommentErrorEvent, async (variables) => {
|
|
23
23
|
const response = await client.query({
|
|
24
24
|
query: CommentsDocument,
|
|
25
25
|
variables,
|
|
@@ -30,7 +30,7 @@ const fetchComments = libExports.createAction(fetchCommentsEvent, fetchCommentEr
|
|
|
30
30
|
count: response.data?.comments?.count,
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
|
-
const createComment =
|
|
33
|
+
const createComment = createAction(createCommentEvent, createCommentErrorEvent, async (variables) => {
|
|
34
34
|
const response = await client.mutate({
|
|
35
35
|
mutation: CreateCommentDocument,
|
|
36
36
|
variables,
|
|
@@ -39,7 +39,7 @@ const createComment = libExports.createAction(createCommentEvent, createCommentE
|
|
|
39
39
|
comment: response.data?.createComment,
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
|
-
const createReplyComment =
|
|
42
|
+
const createReplyComment = createAction(createReplyCommentEvent, createReplyCommentErrorEvent, async (variables) => {
|
|
43
43
|
const response = await client.mutate({
|
|
44
44
|
mutation: CreateReplyCommentDocument,
|
|
45
45
|
variables,
|
|
@@ -48,7 +48,7 @@ const createReplyComment = libExports.createAction(createReplyCommentEvent, crea
|
|
|
48
48
|
comment: response.data?.createReplyComment,
|
|
49
49
|
};
|
|
50
50
|
});
|
|
51
|
-
const openSubscriptionCommentsStoreAction =
|
|
51
|
+
const openSubscriptionCommentsStoreAction = createStoreAction(openSubscriptionCommentsStore, (prev, open) => ({
|
|
52
52
|
...prev,
|
|
53
53
|
open,
|
|
54
54
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.actions.js","sources":["../../../../src/components/comment/comment.actions.ts"],"sourcesContent":["import { createAction, createStoreAction } from '@cobuildlab/react-simple-state';\nimport {\n postStore,\n fetchCommentsStore,\n openSubscriptionCommentsStore,\n replyCommentStore,\n} from './comment.store';\nimport {\n Comment,\n CommentsDocument,\n CommentsQuery,\n CommentsQueryVariables,\n CreateCommentDocument,\n CreateCommentMutation,\n CreateCommentMutationVariables,\n CreateReplyCommentDocument,\n CreateReplyCommentMutation,\n CreateReplyCommentMutationVariables,\n} from '../../shared/types/generated';\nimport {\n createCommentErrorEvent,\n createCommentEvent,\n createReplyCommentErrorEvent,\n createReplyCommentEvent,\n fetchCommentErrorEvent,\n fetchCommentsEvent,\n} from './comment.events';\nimport { apolloClient } from '../../shared/apollo/apollo.client';\n\nconst client = apolloClient();\n\nexport const fetchCommentsStoreAction = createStoreAction(\n fetchCommentsStore,\n (prev, comments: Comment[], count: number) => ({\n ...prev,\n comments,\n count,\n }),\n);\n\nexport const postStoreAction = createStoreAction(postStore, (prev, id: number) => ({\n ...prev,\n id,\n}));\n\nexport const replyCommentStoreAction = createStoreAction(\n replyCommentStore,\n (prev, message: string, commentId: number) => ({\n ...prev,\n message,\n commentId,\n }),\n);\n\nexport const fetchComments = createAction(\n fetchCommentsEvent,\n fetchCommentErrorEvent,\n async (variables: CommentsQueryVariables) => {\n const response = await client.query<CommentsQuery, CommentsQueryVariables>({\n query: CommentsDocument,\n variables,\n fetchPolicy: 'network-only',\n });\n\n return {\n comments: response.data?.comments?.items as Comment[],\n count: response.data?.comments?.count as number,\n };\n },\n);\n\nexport const createComment = createAction(\n createCommentEvent,\n createCommentErrorEvent,\n async (variables: CreateCommentMutationVariables) => {\n const response = await client.mutate<CreateCommentMutation, CreateCommentMutationVariables>({\n mutation: CreateCommentDocument,\n variables,\n });\n\n return {\n comment: response.data?.createComment as Comment,\n };\n },\n);\n\nexport const createReplyComment = createAction(\n createReplyCommentEvent,\n createReplyCommentErrorEvent,\n async (variables: CreateReplyCommentMutationVariables) => {\n const response = await client.mutate<\n CreateReplyCommentMutation,\n CreateReplyCommentMutationVariables\n >({\n mutation: CreateReplyCommentDocument,\n variables,\n });\n\n return {\n comment: response.data?.createReplyComment,\n };\n },\n);\n\nexport const openSubscriptionCommentsStoreAction = createStoreAction(\n openSubscriptionCommentsStore,\n (prev, open: boolean) => ({\n ...prev,\n open,\n }),\n);\n"],"names":[
|
|
1
|
+
{"version":3,"file":"comment.actions.js","sources":["../../../../src/components/comment/comment.actions.ts"],"sourcesContent":["import { createAction, createStoreAction } from '@cobuildlab/react-simple-state';\nimport {\n postStore,\n fetchCommentsStore,\n openSubscriptionCommentsStore,\n replyCommentStore,\n} from './comment.store';\nimport {\n Comment,\n CommentsDocument,\n CommentsQuery,\n CommentsQueryVariables,\n CreateCommentDocument,\n CreateCommentMutation,\n CreateCommentMutationVariables,\n CreateReplyCommentDocument,\n CreateReplyCommentMutation,\n CreateReplyCommentMutationVariables,\n} from '../../shared/types/generated';\nimport {\n createCommentErrorEvent,\n createCommentEvent,\n createReplyCommentErrorEvent,\n createReplyCommentEvent,\n fetchCommentErrorEvent,\n fetchCommentsEvent,\n} from './comment.events';\nimport { apolloClient } from '../../shared/apollo/apollo.client';\n\nconst client = apolloClient();\n\nexport const fetchCommentsStoreAction = createStoreAction(\n fetchCommentsStore,\n (prev, comments: Comment[], count: number) => ({\n ...prev,\n comments,\n count,\n }),\n);\n\nexport const postStoreAction = createStoreAction(postStore, (prev, id: number) => ({\n ...prev,\n id,\n}));\n\nexport const replyCommentStoreAction = createStoreAction(\n replyCommentStore,\n (prev, message: string, commentId: number) => ({\n ...prev,\n message,\n commentId,\n }),\n);\n\nexport const fetchComments = createAction(\n fetchCommentsEvent,\n fetchCommentErrorEvent,\n async (variables: CommentsQueryVariables) => {\n const response = await client.query<CommentsQuery, CommentsQueryVariables>({\n query: CommentsDocument,\n variables,\n fetchPolicy: 'network-only',\n });\n\n return {\n comments: response.data?.comments?.items as Comment[],\n count: response.data?.comments?.count as number,\n };\n },\n);\n\nexport const createComment = createAction(\n createCommentEvent,\n createCommentErrorEvent,\n async (variables: CreateCommentMutationVariables) => {\n const response = await client.mutate<CreateCommentMutation, CreateCommentMutationVariables>({\n mutation: CreateCommentDocument,\n variables,\n });\n\n return {\n comment: response.data?.createComment as Comment,\n };\n },\n);\n\nexport const createReplyComment = createAction(\n createReplyCommentEvent,\n createReplyCommentErrorEvent,\n async (variables: CreateReplyCommentMutationVariables) => {\n const response = await client.mutate<\n CreateReplyCommentMutation,\n CreateReplyCommentMutationVariables\n >({\n mutation: CreateReplyCommentDocument,\n variables,\n });\n\n return {\n comment: response.data?.createReplyComment,\n };\n },\n);\n\nexport const openSubscriptionCommentsStoreAction = createStoreAction(\n openSubscriptionCommentsStore,\n (prev, open: boolean) => ({\n ...prev,\n open,\n }),\n);\n"],"names":[],"mappings":";;;;;;AA6BA,MAAM,MAAM,GAAG,YAAY,EAAE;AAEtB,MAAM,wBAAwB,GAAG,iBAAiB,CACvD,kBAAkB,EAClB,CAAC,IAAI,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A,QAAA,QAAQ,EAAE,0BAA0B;QACpC,SAAS;AACV,KAAA,CAAC;IAEF,OAAO;AACL,QAAA,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB;KAC3C;AACH,CAAC;AAGI,MAAM,mCAAmC,GAAG,iBAAiB,CAClE,6BAA6B,EAC7B,CAAC,IAAI,EAAE,IAAa,MAAM;AACxB,IAAA,GAAG,IAAI;IACP,IAAI;AACL,CAAA,CAAC;;;;"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createEvent } from '@cobuildlab/react-simple-state';
|
|
2
2
|
|
|
3
|
-
const fetchCommentsEvent =
|
|
3
|
+
const fetchCommentsEvent = createEvent({
|
|
4
4
|
initialValue: {
|
|
5
5
|
comments: [],
|
|
6
6
|
count: 0,
|
|
7
7
|
},
|
|
8
8
|
});
|
|
9
|
-
const fetchCommentErrorEvent =
|
|
10
|
-
const createCommentEvent =
|
|
9
|
+
const fetchCommentErrorEvent = createEvent();
|
|
10
|
+
const createCommentEvent = createEvent({
|
|
11
11
|
initialValue: {
|
|
12
12
|
comment: undefined,
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
|
-
const createCommentErrorEvent =
|
|
16
|
-
const createReplyCommentEvent =
|
|
15
|
+
const createCommentErrorEvent = createEvent();
|
|
16
|
+
const createReplyCommentEvent = createEvent({
|
|
17
17
|
initialValue: {
|
|
18
18
|
comment: undefined,
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
|
-
const createReplyCommentErrorEvent =
|
|
21
|
+
const createReplyCommentErrorEvent = createEvent();
|
|
22
22
|
|
|
23
23
|
export { createCommentErrorEvent, createCommentEvent, createReplyCommentErrorEvent, createReplyCommentEvent, fetchCommentErrorEvent, fetchCommentsEvent };
|
|
24
24
|
//# sourceMappingURL=comment.events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.events.js","sources":["../../../../src/components/comment/comment.events.ts"],"sourcesContent":["import { createEvent } from '@cobuildlab/react-simple-state';\nimport { Comment, ReplyComment } from '../../shared/types/generated';\n\nexport const fetchCommentsEvent = createEvent<{\n comments: Comment[];\n count: number;\n}>({\n initialValue: {\n comments: [],\n count: 0,\n },\n});\n\nexport const fetchCommentErrorEvent = createEvent();\n\nexport const createCommentEvent = createEvent<{ comment: Comment | undefined }>({\n initialValue: {\n comment: undefined,\n },\n});\nexport const createCommentErrorEvent = createEvent();\n\nexport const createReplyCommentEvent = createEvent<{\n comment: ReplyComment | undefined;\n}>({\n initialValue: {\n comment: undefined,\n },\n});\nexport const createReplyCommentErrorEvent = createEvent();\n"],"names":[
|
|
1
|
+
{"version":3,"file":"comment.events.js","sources":["../../../../src/components/comment/comment.events.ts"],"sourcesContent":["import { createEvent } from '@cobuildlab/react-simple-state';\nimport { Comment, ReplyComment } from '../../shared/types/generated';\n\nexport const fetchCommentsEvent = createEvent<{\n comments: Comment[];\n count: number;\n}>({\n initialValue: {\n comments: [],\n count: 0,\n },\n});\n\nexport const fetchCommentErrorEvent = createEvent();\n\nexport const createCommentEvent = createEvent<{ comment: Comment | undefined }>({\n initialValue: {\n comment: undefined,\n },\n});\nexport const createCommentErrorEvent = createEvent();\n\nexport const createReplyCommentEvent = createEvent<{\n comment: ReplyComment | undefined;\n}>({\n initialValue: {\n comment: undefined,\n },\n});\nexport const createReplyCommentErrorEvent = createEvent();\n"],"names":[],"mappings":";;AAGO,MAAM,kBAAkB,GAAG,WAAW,CAG1C;AACD,IAAA,YAAY,EAAE;AACZ,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,KAAK,EAAE,CAAC;AACT,KAAA;AACF,CAAA;AAEM,MAAM,sBAAsB,GAAG,WAAW;AAE1C,MAAM,kBAAkB,GAAG,WAAW,CAAmC;AAC9E,IAAA,YAAY,EAAE;AACZ,QAAA,OAAO,EAAE,SAAS;AACnB,KAAA;AACF,CAAA;AACM,MAAM,uBAAuB,GAAG,WAAW;AAE3C,MAAM,uBAAuB,GAAG,WAAW,CAE/C;AACD,IAAA,YAAY,EAAE;AACZ,QAAA,OAAO,EAAE,SAAS;AACnB,KAAA;AACF,CAAA;AACM,MAAM,4BAA4B,GAAG,WAAW;;;;"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createStore } from '@cobuildlab/react-simple-state';
|
|
2
2
|
|
|
3
|
-
const fetchCommentsStore =
|
|
3
|
+
const fetchCommentsStore = createStore({
|
|
4
4
|
initialValue: {
|
|
5
5
|
comments: [],
|
|
6
6
|
count: 0,
|
|
7
7
|
},
|
|
8
8
|
});
|
|
9
|
-
const postStore =
|
|
9
|
+
const postStore = createStore({
|
|
10
10
|
initialValue: {
|
|
11
11
|
id: 0,
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
|
-
const replyCommentStore =
|
|
14
|
+
const replyCommentStore = createStore({
|
|
15
15
|
initialValue: {
|
|
16
16
|
message: '',
|
|
17
17
|
commentId: 0,
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
-
const openSubscriptionCommentsStore =
|
|
20
|
+
const openSubscriptionCommentsStore = createStore({
|
|
21
21
|
initialValue: {
|
|
22
22
|
open: false,
|
|
23
23
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.store.js","sources":["../../../../src/components/comment/comment.store.ts"],"sourcesContent":["import { createStore } from '@cobuildlab/react-simple-state';\nimport { Comment } from '../../shared/types/generated';\nimport { ReplyCommentStore } from './comment.types';\n\nexport const fetchCommentsStore = createStore<{\n comments: Comment[];\n count: number;\n}>({\n initialValue: {\n comments: [],\n count: 0,\n },\n});\n\nexport const postStore = createStore<{ id: number }>({\n initialValue: {\n id: 0,\n },\n});\n\nexport const replyCommentStore = createStore<ReplyCommentStore>({\n initialValue: {\n message: '',\n commentId: 0,\n },\n});\n\nexport const openSubscriptionCommentsStore = createStore<{ open: boolean }>({\n initialValue: {\n open: false,\n },\n});\n"],"names":[
|
|
1
|
+
{"version":3,"file":"comment.store.js","sources":["../../../../src/components/comment/comment.store.ts"],"sourcesContent":["import { createStore } from '@cobuildlab/react-simple-state';\nimport { Comment } from '../../shared/types/generated';\nimport { ReplyCommentStore } from './comment.types';\n\nexport const fetchCommentsStore = createStore<{\n comments: Comment[];\n count: number;\n}>({\n initialValue: {\n comments: [],\n count: 0,\n },\n});\n\nexport const postStore = createStore<{ id: number }>({\n initialValue: {\n id: 0,\n },\n});\n\nexport const replyCommentStore = createStore<ReplyCommentStore>({\n initialValue: {\n message: '',\n commentId: 0,\n },\n});\n\nexport const openSubscriptionCommentsStore = createStore<{ open: boolean }>({\n initialValue: {\n open: false,\n },\n});\n"],"names":[],"mappings":";;AAIO,MAAM,kBAAkB,GAAG,WAAW,CAG1C;AACD,IAAA,YAAY,EAAE;AACZ,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,KAAK,EAAE,CAAC;AACT,KAAA;AACF,CAAA;AAEM,MAAM,SAAS,GAAG,WAAW,CAAiB;AACnD,IAAA,YAAY,EAAE;AACZ,QAAA,EAAE,EAAE,CAAC;AACN,KAAA;AACF,CAAA;AAEM,MAAM,iBAAiB,GAAG,WAAW,CAAoB;AAC9D,IAAA,YAAY,EAAE;AACZ,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,SAAS,EAAE,CAAC;AACb,KAAA;AACF,CAAA;AAEM,MAAM,6BAA6B,GAAG,WAAW,CAAoB;AAC1E,IAAA,YAAY,EAAE;AACZ,QAAA,IAAI,EAAE,KAAK;AACZ,KAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.utils.js","sources":["../../../../src/components/comment/comment.utils.ts"],"sourcesContent":["import { BtnEmoji } from '../../shared/components/react-editor/BtnEmoji';\n\nexport const getCommentPlaceholder = (isAllowed: boolean) => {\n if (isAllowed) return '';\n\n return 'Suscribete para comentar...';\n};\n\nexport const editorToolbar = {\n options: ['inline', 'emoji'],\n inline: {\n inDropdown: false,\n options: ['bold', 'italic'],\n },\n emoji: {\n className: undefined,\n component: BtnEmoji,\n popupClassName: undefined,\n },\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"comment.utils.js","sources":["../../../../src/components/comment/comment.utils.ts"],"sourcesContent":["import { BtnEmoji } from '../../shared/components/react-editor/BtnEmoji';\n\nexport const getCommentPlaceholder = (isAllowed: boolean) => {\n if (isAllowed) return '';\n\n return 'Suscribete para comentar...';\n};\n\nexport const editorToolbar = {\n options: ['inline', 'emoji'],\n inline: {\n inDropdown: false,\n options: ['bold', 'italic'],\n },\n emoji: {\n className: undefined,\n component: BtnEmoji,\n popupClassName: undefined,\n },\n};\n"],"names":[],"mappings":";;;;;;AAEO,MAAM,qBAAqB,GAAG,CAAC,SAAkB,KAAI;AAC1D,IAAA,IAAI,SAAS;AAAE,QAAA,OAAO,EAAE;AAExB,IAAA,OAAO,6BAA6B;AACtC;;;;"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
import { Card, Box, Avatar } from '@mui/material';
|
|
3
4
|
import { ButtonDefault } from '../../../shared/components/buttons/ButtonDefault.js';
|
|
5
|
+
import { makeStyles, createStyles } from '@mui/styles';
|
|
4
6
|
import { useComment } from '../comment.hooks.js';
|
|
5
7
|
import { ReactSimpleWysiwyg } from '../../../shared/components/react-editor/ReactSimpleWysiwyg.js';
|
|
6
8
|
import { useSession } from '../../session/session.hooks.js';
|
|
7
|
-
import {
|
|
9
|
+
import { useCallAction } from '@cobuildlab/react-simple-state';
|
|
8
10
|
import { createComment, openSubscriptionCommentsStoreAction } from '../comment.actions.js';
|
|
9
|
-
import makeStyles from '../../../node_modules/@mui/styles/makeStyles/makeStyles.js';
|
|
10
|
-
import Card from '../../../node_modules/@mui/material/esm/Card/Card.js';
|
|
11
|
-
import Box from '../../../node_modules/@mui/material/esm/Box/Box.js';
|
|
12
|
-
import Avatar from '../../../node_modules/@mui/material/esm/Avatar/Avatar.js';
|
|
13
|
-
import createStyles from '../../../node_modules/@mui/styles/createStyles/createStyles.js';
|
|
14
11
|
|
|
15
12
|
const useStyles = makeStyles((theme) => createStyles({
|
|
16
13
|
cardHeader: {
|
|
@@ -62,7 +59,7 @@ const AddComment = () => {
|
|
|
62
59
|
const { user, subscription } = useSession();
|
|
63
60
|
const [html, setHtml] = useState('');
|
|
64
61
|
const { callAction, postId } = useComment();
|
|
65
|
-
const [callCreateComment, loading] =
|
|
62
|
+
const [callCreateComment, loading] = useCallAction(createComment, {
|
|
66
63
|
onCompleted: () => {
|
|
67
64
|
setHtml('');
|
|
68
65
|
callAction();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddComment.js","sources":["../../../../../src/components/comment/components/AddComment.tsx"],"sourcesContent":["\nimport React, { useState } from 'react';\nimport { Avatar, Box, Card } from '@mui/material';\nimport { ButtonDefault } from '../../../shared/components/buttons/ButtonDefault';\nimport { createStyles, makeStyles } from '@mui/styles';\nimport { useComment } from '../comment.hooks';\n\nimport { ReactSimpleWysiwyg } from '../../../shared/components/react-editor/ReactSimpleWysiwyg';\nimport { useSession } from '../../session/session.hooks';\nimport { useCallAction } from '@cobuildlab/react-simple-state';\nimport { createComment, openSubscriptionCommentsStoreAction } from '../comment.actions';\nimport { Theme } from '@mui/material';\n\nconst useStyles = makeStyles<Theme>((theme: Theme) =>\n createStyles({\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n },\n '& > .MuiCardHeader-avatar': {\n outline: '1px solid #eaecf1',\n borderRadius: '50%',\n },\n },\n button: {\n minWidth: 130,\n '&:disabled': {\n backgroundColor: '#8B8B8B !important',\n },\n },\n addcommentStyles: {\n display: 'flex',\n [theme.breakpoints.down('md')]: {\n display: 'block',\n },\n },\n buttoncommentStyles: {\n marginLeft: 10,\n [theme.breakpoints.down('md')]: {\n marginLeft: 0,\n marginTop: 10,\n },\n },\n avatarStyles: {\n marginRight: 10,\n\n [theme.breakpoints.down('md')]: {\n marginRight: 0,\n marginBottom: 10,\n display: 'flex',\n alignItems: 'center',\n alignContent: 'center',\n },\n },\n name: {\n fontSize: 14,\n fontWeight: 700,\n },\n }),\n);\n\nexport const AddComment: React.FC = () => {\n const classes = useStyles();\n const { user, subscription } = useSession();\n const [html, setHtml] = useState<string>('');\n const { callAction, postId } = useComment();\n\n const [callCreateComment, loading] = useCallAction(createComment, {\n onCompleted: () => {\n setHtml('');\n callAction();\n },\n });\n\n return (\n <Card elevation={0}>\n <Box className={classes.addcommentStyles}>\n {user ? (\n <Box className={classes.avatarStyles}>\n <Avatar sx={{ width: 40, height: 40, marginRight: 1 }} src={user?.avatar as string} />\n <Box sx={{ display: { xs: 'block', md: 'none' } }}>\n <Box className={classes.name} mb={1}>\n {user?.name}\n </Box>\n </Box>\n </Box>\n ) : null}\n {\n <Box component={'div'} style={{ width: '100%' }}>\n <ReactSimpleWysiwyg value={html} onChange={(value) => setHtml(value)} />\n </Box>\n }\n {\n <Box className={classes.buttoncommentStyles}>\n <ButtonDefault\n disabled={!(html && user)}\n onClick={() => {\n if (!subscription) return openSubscriptionCommentsStoreAction(true);\n\n callCreateComment({\n data: {\n message: html,\n post_id: postId,\n },\n });\n }}\n color={!subscription ? 'primary' : 'inherit'}\n isLoading={loading}\n className={classes.button}>\n Comentar\n </ButtonDefault>\n </Box>\n }\n </Box>\n </Card>\n );\n};\n"],"names":["
|
|
1
|
+
{"version":3,"file":"AddComment.js","sources":["../../../../../src/components/comment/components/AddComment.tsx"],"sourcesContent":["\nimport React, { useState } from 'react';\nimport { Avatar, Box, Card } from '@mui/material';\nimport { ButtonDefault } from '../../../shared/components/buttons/ButtonDefault';\nimport { createStyles, makeStyles } from '@mui/styles';\nimport { useComment } from '../comment.hooks';\n\nimport { ReactSimpleWysiwyg } from '../../../shared/components/react-editor/ReactSimpleWysiwyg';\nimport { useSession } from '../../session/session.hooks';\nimport { useCallAction } from '@cobuildlab/react-simple-state';\nimport { createComment, openSubscriptionCommentsStoreAction } from '../comment.actions';\nimport { Theme } from '@mui/material';\n\nconst useStyles = makeStyles<Theme>((theme: Theme) =>\n createStyles({\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n },\n '& > .MuiCardHeader-avatar': {\n outline: '1px solid #eaecf1',\n borderRadius: '50%',\n },\n },\n button: {\n minWidth: 130,\n '&:disabled': {\n backgroundColor: '#8B8B8B !important',\n },\n },\n addcommentStyles: {\n display: 'flex',\n [theme.breakpoints.down('md')]: {\n display: 'block',\n },\n },\n buttoncommentStyles: {\n marginLeft: 10,\n [theme.breakpoints.down('md')]: {\n marginLeft: 0,\n marginTop: 10,\n },\n },\n avatarStyles: {\n marginRight: 10,\n\n [theme.breakpoints.down('md')]: {\n marginRight: 0,\n marginBottom: 10,\n display: 'flex',\n alignItems: 'center',\n alignContent: 'center',\n },\n },\n name: {\n fontSize: 14,\n fontWeight: 700,\n },\n }),\n);\n\nexport const AddComment: React.FC = () => {\n const classes = useStyles();\n const { user, subscription } = useSession();\n const [html, setHtml] = useState<string>('');\n const { callAction, postId } = useComment();\n\n const [callCreateComment, loading] = useCallAction(createComment, {\n onCompleted: () => {\n setHtml('');\n callAction();\n },\n });\n\n return (\n <Card elevation={0}>\n <Box className={classes.addcommentStyles}>\n {user ? (\n <Box className={classes.avatarStyles}>\n <Avatar sx={{ width: 40, height: 40, marginRight: 1 }} src={user?.avatar as string} />\n <Box sx={{ display: { xs: 'block', md: 'none' } }}>\n <Box className={classes.name} mb={1}>\n {user?.name}\n </Box>\n </Box>\n </Box>\n ) : null}\n {\n <Box component={'div'} style={{ width: '100%' }}>\n <ReactSimpleWysiwyg value={html} onChange={(value) => setHtml(value)} />\n </Box>\n }\n {\n <Box className={classes.buttoncommentStyles}>\n <ButtonDefault\n disabled={!(html && user)}\n onClick={() => {\n if (!subscription) return openSubscriptionCommentsStoreAction(true);\n\n callCreateComment({\n data: {\n message: html,\n post_id: postId,\n },\n });\n }}\n color={!subscription ? 'primary' : 'inherit'}\n isLoading={loading}\n className={classes.button}>\n Comentar\n </ButtonDefault>\n </Box>\n }\n </Box>\n </Card>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;AAaA,MAAM,SAAS,GAAG,UAAU,CAAQ,CAAC,KAAY,KAC/C,YAAY,CAAC;AACX,IAAA,UAAU,EAAE;AACV,QAAA,2BAA2B,EAAE;AAC3B,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,WAAW,EAAE,CAAC;AACf,SAAA;AACD,QAAA,2BAA2B,EAAE;AAC3B,YAAA,OAAO,EAAE,mBAAmB;AAC5B,YAAA,YAAY,EAAE,KAAK;AACpB,SAAA;AACF,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,QAAQ,EAAE,GAAG;AACb,QAAA,YAAY,EAAE;AACZ,YAAA,eAAe,EAAE,oBAAoB;AACtC,SAAA;AACF,KAAA;AACD,IAAA,gBAAgB,EAAE;AAChB,QAAA,OAAO,EAAE,MAAM;QACf,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;AAC9B,YAAA,OAAO,EAAE,OAAO;AACjB,SAAA;AACF,KAAA;AACD,IAAA,mBAAmB,EAAE;AACnB,QAAA,UAAU,EAAE,EAAE;QACd,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;AAC9B,YAAA,UAAU,EAAE,CAAC;AACb,YAAA,SAAS,EAAE,EAAE;AACd,SAAA;AACF,KAAA;AACD,IAAA,YAAY,EAAE;AACZ,QAAA,WAAW,EAAE,EAAE;QAEf,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;AAC9B,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,YAAY,EAAE,EAAE;AAChB,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,YAAY,EAAE,QAAQ;A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AAA,QAAA,EAChC,IAAI,EAAE,IAAI,GACP,EAAA,CACF,CAAA,EAAA,CACF,IACJ,IAAI,EAENA,GAAA,CAAC,GAAG,EAAA,EAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAC7CA,GAAA,CAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,EAAA,CAAI,EAAA,CACpE,EAGNA,GAAA,CAAC,GAAG,IAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,EAAA,QAAA,EACzCA,GAAA,CAAC,aAAa,EAAA,EACZ,QAAQ,EAAE,EAAE,IAAI,IAAI,IAAI,CAAC,EACzB,OAAO,EAAE,MAAK;AACZ,4BAAA,IAAI,CAAC,YAAY;AAAE,gCAAA,OAAO,mCAAmC,CAAC,IAAI,CAAC;AAEnE,4BAAA,iBAAiB,CAAC;AAChB,gCAAA,IAAI,EAAE;AACJ,oCAAA,OAAO,EAAE,IAAI;AACb,oCAAA,OAAO,EAAE,MAAM;AAChB,iCAAA;AACF,6BAAA,CAAC;AACJ,wBAAA,CAAC,EACD,KAAK,EAAE,CAAC,YAAY,GAAG,SAAS,GAAG,SAAS,EAC5C,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,OAAO,CAAC,MAAM,EAAA,QAAA,EAAA,UAAA,EAAA,CAEX,EAAA,CACZ,CAAA,EAAA,CAEJ,EAAA,CACD;AAEX;;;;"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { Card, CardHeader, Box, Divider, CardContent } from '@mui/material';
|
|
2
3
|
import { AddComment } from './AddComment.js';
|
|
4
|
+
import { makeStyles } from '@mui/styles';
|
|
3
5
|
import { r as routerExports } from '../../../_virtual/router.js';
|
|
4
6
|
import { theme } from '../../../shared/mui/theme.js';
|
|
5
7
|
import { URL_PORTAL } from '../../../shared/constants/index.js';
|
|
6
8
|
import { useSession } from '../../session/session.hooks.js';
|
|
7
|
-
import makeStyles from '../../../node_modules/@mui/styles/makeStyles/makeStyles.js';
|
|
8
|
-
import Card from '../../../node_modules/@mui/material/esm/Card/Card.js';
|
|
9
|
-
import CardHeader from '../../../node_modules/@mui/material/esm/CardHeader/CardHeader.js';
|
|
10
|
-
import Box from '../../../node_modules/@mui/material/esm/Box/Box.js';
|
|
11
|
-
import Divider from '../../../node_modules/@mui/material/esm/Divider/Divider.js';
|
|
12
|
-
import CardContent from '../../../node_modules/@mui/material/esm/CardContent/CardContent.js';
|
|
13
9
|
|
|
14
10
|
const useStyles = makeStyles({
|
|
15
11
|
text: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddCommentContainer.js","sources":["../../../../../src/components/comment/components/AddCommentContainer.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { Box, Card, CardHeader, CardContent, Divider } from '@mui/material';\nimport { AddComment } from './AddComment';\nimport { makeStyles } from '@mui/styles';\nimport { useRouter } from 'next/router';\nimport { theme } from '../../../shared/mui/theme';\nimport { URL_PORTAL } from '../../../shared/constants';\nimport { useSession } from '../../session/session.hooks';\n\nconst useStyles = makeStyles({\n text: {\n cursor: 'pointer',\n textDecoration: 'underline',\n paddingLeft: theme.spacing(0.5),\n paddingRight: theme.spacing(0.5),\n fontWeight: 700,\n },\n name: {\n fontSize: 14,\n fontWeight: 700,\n },\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n marginBottom: theme.spacing(1),\n },\n alignItems: 'center',\n },\n});\n\nexport const AddCommentContainer: React.FC = () => {\n const classes = useStyles();\n const { user, subscription } = useSession();\n const router = useRouter();\n const redirectTo = (url: string) => {\n const redirectUrl = new URL(url);\n redirectUrl.searchParams.append('redirect_url', window.location.href);\n window.location.href = redirectUrl.href;\n };\n\n return (\n <Card elevation={1} sx={{ px: 2, pt: 2 }}>\n <CardHeader\n sx={{ p: 0 }}\n title={\n user ? (\n <Box sx={{ display: { xs: 'none', lg: 'block' } }}>\n <Box className={classes.name} mb={1}>\n {user?.name}\n </Box>\n </Box>\n ) : null\n }\n className={classes.cardHeader}\n action={\n !user ? (\n <Box display=\"flex\">\n <Box\n className={classes.text}\n onClick={() => redirectTo(`${URL_PORTAL}/autenticacion?action=AUTH_LOGIN`)}>\n Iniciar sesión\n </Box>\n <Divider orientation=\"vertical\" flexItem sx={{ mr: 1, ml: 1 }} />\n <Box\n className={classes.text}\n onClick={() => redirectTo(`${URL_PORTAL}/autenticacion?action=AUTH_REGISTER`)}>\n Registrate\n </Box>\n </Box>\n ) : (\n <>\n {!subscription ? (\n <Box display=\"flex\">\n <Box\n className={classes.text}\n component={'a'}\n href={`${URL_PORTAL}/planes?post_url=${URL_PORTAL}${router.asPath}`}>\n Suscríbete\n </Box>\n </Box>\n ) : null}\n </>\n )\n }\n />\n <CardContent sx={{ p: 0 }}>\n <AddComment />\n </CardContent>\n </Card>\n );\n};\n"],"names":["useRouter","_jsxs","_jsx","_Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddCommentContainer.js","sources":["../../../../../src/components/comment/components/AddCommentContainer.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { Box, Card, CardHeader, CardContent, Divider } from '@mui/material';\nimport { AddComment } from './AddComment';\nimport { makeStyles } from '@mui/styles';\nimport { useRouter } from 'next/router';\nimport { theme } from '../../../shared/mui/theme';\nimport { URL_PORTAL } from '../../../shared/constants';\nimport { useSession } from '../../session/session.hooks';\n\nconst useStyles = makeStyles({\n text: {\n cursor: 'pointer',\n textDecoration: 'underline',\n paddingLeft: theme.spacing(0.5),\n paddingRight: theme.spacing(0.5),\n fontWeight: 700,\n },\n name: {\n fontSize: 14,\n fontWeight: 700,\n },\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n marginBottom: theme.spacing(1),\n },\n alignItems: 'center',\n },\n});\n\nexport const AddCommentContainer: React.FC = () => {\n const classes = useStyles();\n const { user, subscription } = useSession();\n const router = useRouter();\n const redirectTo = (url: string) => {\n const redirectUrl = new URL(url);\n redirectUrl.searchParams.append('redirect_url', window.location.href);\n window.location.href = redirectUrl.href;\n };\n\n return (\n <Card elevation={1} sx={{ px: 2, pt: 2 }}>\n <CardHeader\n sx={{ p: 0 }}\n title={\n user ? (\n <Box sx={{ display: { xs: 'none', lg: 'block' } }}>\n <Box className={classes.name} mb={1}>\n {user?.name}\n </Box>\n </Box>\n ) : null\n }\n className={classes.cardHeader}\n action={\n !user ? (\n <Box display=\"flex\">\n <Box\n className={classes.text}\n onClick={() => redirectTo(`${URL_PORTAL}/autenticacion?action=AUTH_LOGIN`)}>\n Iniciar sesión\n </Box>\n <Divider orientation=\"vertical\" flexItem sx={{ mr: 1, ml: 1 }} />\n <Box\n className={classes.text}\n onClick={() => redirectTo(`${URL_PORTAL}/autenticacion?action=AUTH_REGISTER`)}>\n Registrate\n </Box>\n </Box>\n ) : (\n <>\n {!subscription ? (\n <Box display=\"flex\">\n <Box\n className={classes.text}\n component={'a'}\n href={`${URL_PORTAL}/planes?post_url=${URL_PORTAL}${router.asPath}`}>\n Suscríbete\n </Box>\n </Box>\n ) : null}\n </>\n )\n }\n />\n <CardContent sx={{ p: 0 }}>\n <AddComment />\n </CardContent>\n </Card>\n );\n};\n"],"names":["useRouter","_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;AAWA,MAAM,SAAS,GAAG,UAAU,CAAC;AAC3B,IAAA,IAAI,EAAE;AACJ,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,cAAc,EAAE,WAAW;AAC3B,QAAA,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;AAC/B,QAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;AAChC,QAAA,UAAU,EAAE,GAAG;AAChB,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,QAAQ,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AC,EAAE,EAAA,QAAA,EACvBA,GAAA,CAAC,UAAU,EAAA,EAAA,CAAG,EAAA,CACF,CAAA,EAAA,CACT;AAEX;;;;"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Card, CardHeader, Box, Avatar } from '@mui/material';
|
|
4
|
+
import { EditorProvider } from 'react-simple-wysiwyg';
|
|
4
5
|
import { ButtonDefault } from '../../../shared/components/buttons/ButtonDefault.js';
|
|
6
|
+
import { makeStyles } from '@mui/styles';
|
|
5
7
|
import { useComment } from '../comment.hooks.js';
|
|
6
8
|
import { ReactSimpleWysiwyg } from '../../../shared/components/react-editor/ReactSimpleWysiwyg.js';
|
|
7
|
-
import {
|
|
9
|
+
import { useStore, useCallAction } from '@cobuildlab/react-simple-state';
|
|
8
10
|
import { replyCommentStore } from '../comment.store.js';
|
|
9
11
|
import { createReplyComment, replyCommentStoreAction, openSubscriptionCommentsStoreAction } from '../comment.actions.js';
|
|
10
12
|
import { useSession } from '../../session/session.hooks.js';
|
|
11
|
-
import makeStyles from '../../../node_modules/@mui/styles/makeStyles/makeStyles.js';
|
|
12
|
-
import Card from '../../../node_modules/@mui/material/esm/Card/Card.js';
|
|
13
|
-
import CardHeader from '../../../node_modules/@mui/material/esm/CardHeader/CardHeader.js';
|
|
14
|
-
import Box from '../../../node_modules/@mui/material/esm/Box/Box.js';
|
|
15
|
-
import Avatar from '../../../node_modules/@mui/material/esm/Avatar/Avatar.js';
|
|
16
13
|
|
|
17
14
|
const useStyles = makeStyles({
|
|
18
15
|
cardHeader: {
|
|
@@ -32,10 +29,10 @@ const useStyles = makeStyles({
|
|
|
32
29
|
const AddReplyComment = () => {
|
|
33
30
|
const classes = useStyles();
|
|
34
31
|
const { user, subscription } = useSession();
|
|
35
|
-
const { message, commentId } =
|
|
32
|
+
const { message, commentId } = useStore(replyCommentStore);
|
|
36
33
|
const [html, setHtml] = useState(message);
|
|
37
34
|
const { callAction, postId } = useComment();
|
|
38
|
-
const [callCreateComment, loading] =
|
|
35
|
+
const [callCreateComment, loading] = useCallAction(createReplyComment, {
|
|
39
36
|
onCompleted: () => {
|
|
40
37
|
callAction();
|
|
41
38
|
replyCommentStoreAction('', 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddReplyComment.js","sources":["../../../../../src/components/comment/components/AddReplyComment.tsx"],"sourcesContent":["\n\nimport React, { useState } from 'react';\nimport { Avatar, Box, Card, CardHeader } from '@mui/material';\nimport { EditorProvider } from 'react-simple-wysiwyg';\nimport { ButtonDefault } from '../../../shared/components/buttons/ButtonDefault';\nimport { makeStyles } from '@mui/styles';\nimport { useComment } from '../comment.hooks';\nimport { ReactSimpleWysiwyg } from '../../../shared/components/react-editor/ReactSimpleWysiwyg';\nimport { useCallAction, useStore } from '@cobuildlab/react-simple-state';\nimport { replyCommentStore } from '../comment.store';\nimport {\n createReplyComment,\n openSubscriptionCommentsStoreAction,\n replyCommentStoreAction,\n} from '../comment.actions';\nimport { useSession } from '../../session/session.hooks';\n\nconst useStyles = makeStyles({\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n },\n '& > .MuiCardHeader-avatar': {\n outline: '1px solid #eaecf1',\n borderRadius: '50%',\n },\n },\n button: {\n minWidth: 130,\n },\n});\n\nexport const AddReplyComment: React.FC = () => {\n const classes = useStyles();\n const { user, subscription } = useSession();\n const { message, commentId } = useStore(replyCommentStore);\n const [html, setHtml] = useState<string>(message);\n const { callAction, postId } = useComment();\n\n const [callCreateComment, loading] = useCallAction(createReplyComment, {\n onCompleted: () => {\n callAction();\n replyCommentStoreAction('', 0);\n },\n });\n\n console.log({ html });\n\n return (\n <EditorProvider>\n <Card elevation={0}>\n <CardHeader\n sx={{ p: 0 }}\n className={classes.cardHeader}\n avatar={\n user ? (\n <Avatar\n sx={{ width: 40, height: 40 }}\n src={user?.avatar as string}\n />\n ) : null\n }\n title={\n <ReactSimpleWysiwyg\n value={html}\n onChange={(value) => setHtml(value)}\n />\n }\n action={\n <Box ml={2}>\n <ButtonDefault\n disabled={!(html && user)}\n onClick={() => {\n if (!subscription)\n return openSubscriptionCommentsStoreAction(true);\n\n callCreateComment({\n data: {\n message: html,\n post_id: postId,\n comment_id: commentId,\n },\n });\n }}\n color=\"primary\"\n isLoading={loading}\n className={classes.button}\n >\n Comentar\n </ButtonDefault>\n </Box>\n }\n />\n </Card>\n </EditorProvider>\n );\n};\n"],"names":["
|
|
1
|
+
{"version":3,"file":"AddReplyComment.js","sources":["../../../../../src/components/comment/components/AddReplyComment.tsx"],"sourcesContent":["\n\nimport React, { useState } from 'react';\nimport { Avatar, Box, Card, CardHeader } from '@mui/material';\nimport { EditorProvider } from 'react-simple-wysiwyg';\nimport { ButtonDefault } from '../../../shared/components/buttons/ButtonDefault';\nimport { makeStyles } from '@mui/styles';\nimport { useComment } from '../comment.hooks';\nimport { ReactSimpleWysiwyg } from '../../../shared/components/react-editor/ReactSimpleWysiwyg';\nimport { useCallAction, useStore } from '@cobuildlab/react-simple-state';\nimport { replyCommentStore } from '../comment.store';\nimport {\n createReplyComment,\n openSubscriptionCommentsStoreAction,\n replyCommentStoreAction,\n} from '../comment.actions';\nimport { useSession } from '../../session/session.hooks';\n\nconst useStyles = makeStyles({\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n },\n '& > .MuiCardHeader-avatar': {\n outline: '1px solid #eaecf1',\n borderRadius: '50%',\n },\n },\n button: {\n minWidth: 130,\n },\n});\n\nexport const AddReplyComment: React.FC = () => {\n const classes = useStyles();\n const { user, subscription } = useSession();\n const { message, commentId } = useStore(replyCommentStore);\n const [html, setHtml] = useState<string>(message);\n const { callAction, postId } = useComment();\n\n const [callCreateComment, loading] = useCallAction(createReplyComment, {\n onCompleted: () => {\n callAction();\n replyCommentStoreAction('', 0);\n },\n });\n\n console.log({ html });\n\n return (\n <EditorProvider>\n <Card elevation={0}>\n <CardHeader\n sx={{ p: 0 }}\n className={classes.cardHeader}\n avatar={\n user ? (\n <Avatar\n sx={{ width: 40, height: 40 }}\n src={user?.avatar as string}\n />\n ) : null\n }\n title={\n <ReactSimpleWysiwyg\n value={html}\n onChange={(value) => setHtml(value)}\n />\n }\n action={\n <Box ml={2}>\n <ButtonDefault\n disabled={!(html && user)}\n onClick={() => {\n if (!subscription)\n return openSubscriptionCommentsStoreAction(true);\n\n callCreateComment({\n data: {\n message: html,\n post_id: postId,\n comment_id: commentId,\n },\n });\n }}\n color=\"primary\"\n isLoading={loading}\n className={classes.button}\n >\n Comentar\n </ButtonDefault>\n </Box>\n }\n />\n </Card>\n </EditorProvider>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,SAAS,GAAG,UAAU,CAAC;AAC3B,IAAA,UAAU,EAAE;AACV,QAAA,2BAA2B,EAAE;AAC3B,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,WAAW,EAAE,CAAC;AACf,SAAA;AACD,QAAA,2BAA2B,EAAE;AAC3B,YAAA,OAAO,EAAE,mBAAmB;AAC5B,YAAA,YAAY,EAAE,KAAK;AACpB,SAAA;AACF,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,QAAQ,EAAE,GAAG;AACd,KAAA;AACF,CAAA,CAAC;AAEK,MAAM,eAAe,GAAa,MAAK;AAC5C,IAAA,MAAM,OAAO,GAAG,SAAS,EAAE;IAC3B,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,UAAU,EAAE;IAC3C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,iBAAiB,CAAC;IAC1D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAS,OAAO,CAAC;IACjD,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE;IAE3C,MAAM,CAAC,iBAAiB,EAAE,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EACD,KAAK,EAAC,SAAS,EACf,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,OAAO,CAAC,MAAM,EAAA,QAAA,EAAA,UAAA,EAAA,CAGX,EAAA,CACZ,GAER,EAAA,CACG,EAAA,CACQ;AAErB;;;;"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Card, CardHeader, Box, CardContent } from '@mui/material';
|
|
3
|
+
import { makeStyles } from '@mui/styles';
|
|
2
4
|
import { AddReplyComment } from './AddReplyComment.js';
|
|
3
5
|
import { useSession } from '../../session/session.hooks.js';
|
|
4
6
|
import { theme } from '../../../shared/mui/theme.js';
|
|
5
|
-
import makeStyles from '../../../node_modules/@mui/styles/makeStyles/makeStyles.js';
|
|
6
|
-
import Card from '../../../node_modules/@mui/material/esm/Card/Card.js';
|
|
7
|
-
import CardHeader from '../../../node_modules/@mui/material/esm/CardHeader/CardHeader.js';
|
|
8
|
-
import Box from '../../../node_modules/@mui/material/esm/Box/Box.js';
|
|
9
|
-
import CardContent from '../../../node_modules/@mui/material/esm/CardContent/CardContent.js';
|
|
10
7
|
|
|
11
8
|
const useStyles = makeStyles({
|
|
12
9
|
name: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddReplyCommentContainer.js","sources":["../../../../../src/components/comment/components/AddReplyCommentContainer.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { Box, Card, CardHeader, CardContent } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\n\nimport { AddReplyComment } from './AddReplyComment';\nimport { useSession } from '../../session/session.hooks';\nimport { theme } from '../../../shared/mui/theme';\n\nconst useStyles = makeStyles({\n name: {\n fontSize: 14,\n fontWeight: 700,\n },\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n marginBottom: theme.spacing(1),\n },\n alignItems: 'center',\n },\n});\n\nexport const AddReplyCommentContainer: React.FC = () => {\n const classes = useStyles();\n const { user } = useSession();\n\n return (\n <Card elevation={1} sx={{ px: 2, pt: 2 }}>\n <CardHeader\n sx={{ p: 0 }}\n title={\n user ? (\n <Box className={classes.name} mb={1}>\n {user?.name}\n </Box>\n ) : null\n }\n className={classes.cardHeader}\n />\n <CardContent sx={{ p: 0 }}>\n <AddReplyComment />\n </CardContent>\n </Card>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddReplyCommentContainer.js","sources":["../../../../../src/components/comment/components/AddReplyCommentContainer.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { Box, Card, CardHeader, CardContent } from '@mui/material';\nimport { makeStyles } from '@mui/styles';\n\nimport { AddReplyComment } from './AddReplyComment';\nimport { useSession } from '../../session/session.hooks';\nimport { theme } from '../../../shared/mui/theme';\n\nconst useStyles = makeStyles({\n name: {\n fontSize: 14,\n fontWeight: 700,\n },\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n marginBottom: theme.spacing(1),\n },\n alignItems: 'center',\n },\n});\n\nexport const AddReplyCommentContainer: React.FC = () => {\n const classes = useStyles();\n const { user } = useSession();\n\n return (\n <Card elevation={1} sx={{ px: 2, pt: 2 }}>\n <CardHeader\n sx={{ p: 0 }}\n title={\n user ? (\n <Box className={classes.name} mb={1}>\n {user?.name}\n </Box>\n ) : null\n }\n className={classes.cardHeader}\n />\n <CardContent sx={{ p: 0 }}>\n <AddReplyComment />\n </CardContent>\n </Card>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAUA,MAAM,SAAS,GAAG,UAAU,CAAC;AAC3B,IAAA,IAAI,EAAE;AACJ,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,UAAU,EAAE,GAAG;AAChB,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,2BAA2B,EAAE;AAC3B,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/B,SAAA;AACD,QAAA,UAAU,EAAE,QAAQ;AACrB,KAAA;AACF,CAAA,CAAC;AAEK,MAAM,wBAAwB,GAAa,MAAK;AACrD,IAAA,MAAM,OAAO,GAAG,SAAS,EAAE;AAC3B,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE;AAE7B,IAAA,QACEA,IAAA,CAAC,IAAI,IAAC,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAA,QAAA,EAAA,CACtCC,GAAA,CAAC,UAAU,IACT,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EACZ,KAAK,EACH,IAAI,IACFA,GAAA,CAAC,GAAG,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,YAChC,IAAI,EAAE,IAAI,EAAA,CACP,IACJ,IAAI,EAEV,SAAS,EAAE,OAAO,CAAC,UAAU,GAC7B,EACFA,GAAA,CAAC,WAAW,EAAA,EAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,YACvBA,GAAA,CAAC,eAAe,KAAG,EAAA,CACP,CAAA,EAAA,CACT;AAEX;;;;"}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Grid, Box, Divider } from '@mui/material';
|
|
2
3
|
import { ReplyComments } from './ReplyComments.js';
|
|
3
4
|
import { CommentItem } from './CommentItem.js';
|
|
4
|
-
import {
|
|
5
|
+
import { useStore } from '@cobuildlab/react-simple-state';
|
|
5
6
|
import { replyCommentStore } from '../comment.store.js';
|
|
6
7
|
import { AddReplyCommentContainer } from './AddReplyCommentContainer.js';
|
|
7
8
|
import { replyCommentStoreAction } from '../comment.actions.js';
|
|
8
9
|
import { PRIMARY_COLOR } from '../../../shared/mui/theme.js';
|
|
9
|
-
import Grid from '../../../node_modules/@mui/material/esm/Grid/Grid.js';
|
|
10
|
-
import Box from '../../../node_modules/@mui/material/esm/Box/Box.js';
|
|
11
|
-
import Divider from '../../../node_modules/@mui/material/esm/Divider/Divider.js';
|
|
12
10
|
|
|
13
11
|
const CommentContainer = ({ comment }) => {
|
|
14
|
-
const { commentId } =
|
|
12
|
+
const { commentId } = useStore(replyCommentStore);
|
|
15
13
|
const onReply = (r) => {
|
|
16
14
|
console.log({ r });
|
|
17
15
|
if (comment.id === commentId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentContainer.js","sources":["../../../../../src/components/comment/components/CommentContainer.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { Comment, ReplyComment } from '../../../shared/types/generated';\nimport { Box, Divider, Grid } from '@mui/material';\nimport { ReplyComments } from './ReplyComments';\nimport { CommentItem } from './CommentItem';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { replyCommentStore } from '../comment.store';\nimport { AddReplyCommentContainer } from './AddReplyCommentContainer';\nimport { replyCommentStoreAction } from '../comment.actions';\nimport { PRIMARY_COLOR } from '../../../shared/mui/theme';\n\ntype CommentContainerProps = {\n comment: Comment;\n};\nexport const CommentContainer: React.FC<CommentContainerProps> = ({ comment }) => {\n const { commentId } = useStore(replyCommentStore);\n\n const onReply = (r: Comment | ReplyComment) => {\n console.log({ r });\n if (comment.id === commentId) {\n replyCommentStoreAction('', 0);\n } else {\n replyCommentStoreAction(\n `<b style=\"color:${PRIMARY_COLOR}\">@${r.user?.name}</b> `,\n comment.id as number,\n );\n }\n };\n\n const selectedComment = commentId === comment.id;\n const haveReplyComments = comment.replies?.length;\n\n return (\n <Grid container>\n <Grid size={12} mb={2}>\n <CommentItem comment={comment} onReply={onReply} />\n </Grid>\n {selectedComment || haveReplyComments ? (\n <Grid size={12} mb={2}>\n <Grid container>\n <Grid size={1}>\n <Box display=\"flex\" height=\"100%\" justifyContent=\"center\">\n <Divider orientation=\"vertical\" flexItem />\n </Box>\n </Grid>\n <Grid size={11}>\n <Grid container spacing={2}>\n {haveReplyComments ? (\n <Grid size={12}>\n <ReplyComments\n replyComments={(comment.replies || []) as ReplyComment[]}\n onReply={onReply}\n />\n </Grid>\n ) : null}\n {selectedComment ? (\n <Grid size={12}>\n <AddReplyCommentContainer />\n </Grid>\n ) : null}\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n ) : null}\n </Grid>\n );\n};\n"],"names":["
|
|
1
|
+
{"version":3,"file":"CommentContainer.js","sources":["../../../../../src/components/comment/components/CommentContainer.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { Comment, ReplyComment } from '../../../shared/types/generated';\nimport { Box, Divider, Grid } from '@mui/material';\nimport { ReplyComments } from './ReplyComments';\nimport { CommentItem } from './CommentItem';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { replyCommentStore } from '../comment.store';\nimport { AddReplyCommentContainer } from './AddReplyCommentContainer';\nimport { replyCommentStoreAction } from '../comment.actions';\nimport { PRIMARY_COLOR } from '../../../shared/mui/theme';\n\ntype CommentContainerProps = {\n comment: Comment;\n};\nexport const CommentContainer: React.FC<CommentContainerProps> = ({ comment }) => {\n const { commentId } = useStore(replyCommentStore);\n\n const onReply = (r: Comment | ReplyComment) => {\n console.log({ r });\n if (comment.id === commentId) {\n replyCommentStoreAction('', 0);\n } else {\n replyCommentStoreAction(\n `<b style=\"color:${PRIMARY_COLOR}\">@${r.user?.name}</b> `,\n comment.id as number,\n );\n }\n };\n\n const selectedComment = commentId === comment.id;\n const haveReplyComments = comment.replies?.length;\n\n return (\n <Grid container>\n <Grid size={12} mb={2}>\n <CommentItem comment={comment} onReply={onReply} />\n </Grid>\n {selectedComment || haveReplyComments ? (\n <Grid size={12} mb={2}>\n <Grid container>\n <Grid size={1}>\n <Box display=\"flex\" height=\"100%\" justifyContent=\"center\">\n <Divider orientation=\"vertical\" flexItem />\n </Box>\n </Grid>\n <Grid size={11}>\n <Grid container spacing={2}>\n {haveReplyComments ? (\n <Grid size={12}>\n <ReplyComments\n replyComments={(comment.replies || []) as ReplyComment[]}\n onReply={onReply}\n />\n </Grid>\n ) : null}\n {selectedComment ? (\n <Grid size={12}>\n <AddReplyCommentContainer />\n </Grid>\n ) : null}\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n ) : null}\n </Grid>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;MAgBa,gBAAgB,GAAoC,CAAC,EAAE,OAAO,EAAE,KAAI;IAC/E,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,iBAAiB,CAAC;AAEjD,IAAA,MAAM,OAAO,GAAG,CAAC,CAAyB,KAAI;AAC5C,QAAA,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;AAClB,QAAA,IAAI,OAAO,CAAC,EAAE,KAAK,SAAS,EAAE;AAC5B,YAAA,uBAAuB,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC;aAAO;AACL,YAAA,uBAAuB,CACrB,CAAA,gBAAA,EAAmB,aAAa,CAAA,GAAA,EAAM,CAAC,CAAC,IAAI,EAAE,IAAI,YAAY,EAC9D,OAAO,CAAC,EAAY,CACrB;QACH;AACF,IAAA,CAAC;AAED,IAAA,MAAM,eAAe,GAAG,SAAS,KAAK,OAAO,CAAC,EAAE;AAChD,IAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,EAAE,MAAM;AAEjD,IAAA,QACEA,IAAA,CAAC,IAAI,EAAA,EAAC,SAAS,mBACbC,GAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,YACnBA,GAAA,CAAC,WAAW,EAAA,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAI,EAAA,CAC9C,EACN,eAAe,IAAI,iBAAiB,IACnCA,GAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA,QAAA,EACnBD,IAAA,CAAC,IAAI,EAAA,EAAC,SAAS,EAAA,IAAA,EAAA,QAAA,EAAA,CACbC,GAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,CAAC,EAAA,QAAA,EACXA,IAAC,GAAG,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,EAAA,QAAA,EACvDA,GAAA,CAAC,OAAO,EAAA,EAAC,WAAW,EAAC,UAAU,EAAC,QAAQ,EAAA,IAAA,EAAA,CAAG,EAAA,CACvC,EAAA,CACD,EACPA,IAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,YACZD,IAAA,CAAC,IAAI,EAAA,EAAC,SAAS,QAAC,OAAO,EAAE,CAAC,EAAA,QAAA,EAAA,CACvB,iBAAiB,IAChBC,GAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAA,QAAA,EACZA,IAAC,aAAa,EAAA,EACZ,aAAa,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAmB,EACxD,OAAO,EAAE,OAAO,GAChB,EAAA,CACG,IACL,IAAI,EACP,eAAe,IACdA,GAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,EAAE,EAAA,QAAA,EACZA,GAAA,CAAC,wBAAwB,KAAG,EAAA,CACvB,IACL,IAAI,CAAA,EAAA,CACH,EAAA,CACF,CAAA,EAAA,CACF,EAAA,CACF,IACL,IAAI,CAAA,EAAA,CACH;AAEX;;;;"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Card, CardHeader, Box, Typography, Avatar, CardContent } from '@mui/material';
|
|
3
|
+
import { makeStyles } from '@mui/styles';
|
|
2
4
|
import moment from '../../../_virtual/moment.js';
|
|
3
5
|
import ReplyIcon from '../../../node_modules/@mui/icons-material/esm/Reply.js';
|
|
4
6
|
import '../../../_virtual/es.js';
|
|
5
|
-
import makeStyles from '../../../node_modules/@mui/styles/makeStyles/makeStyles.js';
|
|
6
|
-
import Card from '../../../node_modules/@mui/material/esm/Card/Card.js';
|
|
7
|
-
import CardHeader from '../../../node_modules/@mui/material/esm/CardHeader/CardHeader.js';
|
|
8
|
-
import Box from '../../../node_modules/@mui/material/esm/Box/Box.js';
|
|
9
|
-
import Typography from '../../../node_modules/@mui/material/esm/Typography/Typography.js';
|
|
10
|
-
import Avatar from '../../../node_modules/@mui/material/esm/Avatar/Avatar.js';
|
|
11
|
-
import CardContent from '../../../node_modules/@mui/material/esm/CardContent/CardContent.js';
|
|
12
7
|
|
|
13
8
|
moment.locale('es');
|
|
14
9
|
const useStyles = makeStyles({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentItem.js","sources":["../../../../../src/components/comment/components/CommentItem.tsx"],"sourcesContent":["\n\n\nimport React from 'react';\nimport { Comment, ReplyComment } from '../../../shared/types/generated';\nimport {\n Avatar,\n Box,\n Card,\n CardContent,\n CardHeader,\n Typography,\n} from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport moment from 'moment/moment';\nimport ReplyIcon from '@mui/icons-material/Reply';\nimport 'moment/locale/es';\n\nmoment.locale('es');\n\nconst useStyles = makeStyles({\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n },\n '& > .MuiCardHeader-avatar': {\n outline: '1px solid #eaecf1',\n borderRadius: '50%',\n },\n alignItems: 'center',\n },\n reply: {\n cursor: 'pointer',\n },\n});\n\ntype CommentItemProps = {\n comment: Comment | ReplyComment;\n onReply: (comment: Comment | ReplyComment) => void;\n};\nexport const CommentItem: React.FC<CommentItemProps> = ({\n comment,\n onReply,\n}) => {\n const classes = useStyles();\n const { user } = comment;\n\n return (\n <Card>\n <CardHeader\n className={classes.cardHeader}\n title={\n <Box display=\"flex\">\n <Typography variant=\"body1\" fontWeight={700} mr={1} fontSize={14}>\n {user?.name}\n </Typography>\n <Typography variant=\"body1\" fontSize={14}>\n {moment(parseInt(comment.created_at as string)).fromNow()}\n </Typography>\n </Box>\n }\n avatar={\n <Avatar sx={{ width: 40, height: 40 }} src={user?.avatar as string} />\n }\n action={\n <Box\n display=\"flex\"\n alignItems=\"center\"\n className={classes.reply}\n onClick={() => {\n onReply(comment);\n }}\n >\n <ReplyIcon color=\"primary\" />\n <Typography variant=\"body2\" fontWeight={700} color=\"primary\">\n {' '}\n Responder\n </Typography>\n </Box>\n }\n />\n <CardContent>\n <div\n dangerouslySetInnerHTML={{ __html: comment.message as string }}\n ></div>\n </CardContent>\n </Card>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommentItem.js","sources":["../../../../../src/components/comment/components/CommentItem.tsx"],"sourcesContent":["\n\n\nimport React from 'react';\nimport { Comment, ReplyComment } from '../../../shared/types/generated';\nimport {\n Avatar,\n Box,\n Card,\n CardContent,\n CardHeader,\n Typography,\n} from '@mui/material';\nimport { makeStyles } from '@mui/styles';\nimport moment from 'moment/moment';\nimport ReplyIcon from '@mui/icons-material/Reply';\nimport 'moment/locale/es';\n\nmoment.locale('es');\n\nconst useStyles = makeStyles({\n cardHeader: {\n '& > .MuiCardHeader-action': {\n marginTop: 0,\n marginRight: 0,\n },\n '& > .MuiCardHeader-avatar': {\n outline: '1px solid #eaecf1',\n borderRadius: '50%',\n },\n alignItems: 'center',\n },\n reply: {\n cursor: 'pointer',\n },\n});\n\ntype CommentItemProps = {\n comment: Comment | ReplyComment;\n onReply: (comment: Comment | ReplyComment) => void;\n};\nexport const CommentItem: React.FC<CommentItemProps> = ({\n comment,\n onReply,\n}) => {\n const classes = useStyles();\n const { user } = comment;\n\n return (\n <Card>\n <CardHeader\n className={classes.cardHeader}\n title={\n <Box display=\"flex\">\n <Typography variant=\"body1\" fontWeight={700} mr={1} fontSize={14}>\n {user?.name}\n </Typography>\n <Typography variant=\"body1\" fontSize={14}>\n {moment(parseInt(comment.created_at as string)).fromNow()}\n </Typography>\n </Box>\n }\n avatar={\n <Avatar sx={{ width: 40, height: 40 }} src={user?.avatar as string} />\n }\n action={\n <Box\n display=\"flex\"\n alignItems=\"center\"\n className={classes.reply}\n onClick={() => {\n onReply(comment);\n }}\n >\n <ReplyIcon color=\"primary\" />\n <Typography variant=\"body2\" fontWeight={700} color=\"primary\">\n {' '}\n Responder\n </Typography>\n </Box>\n }\n />\n <CardContent>\n <div\n dangerouslySetInnerHTML={{ __html: comment.message as string }}\n ></div>\n </CardContent>\n </Card>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAkBA,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;AAEnB,MAAM,SAAS,GAAG,UAAU,CAAC;AAC3B,IAAA,UAAU,EAAE;AACV,QAAA,2BAA2B,EAAE;AAC3B,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,WAAW,EAAE,CAAC;AACf,SAAA;AACD,QAAA,2BAA2B,EAAE;AAC3B,YAAA,OAAO,EAAE,mBAAmB;AAC5B,YAAA,YAAY,EAAE,KAAK;AACpB,SAAA;AACD,QAAA,UAAU,EAAE,QAAQ;AACrB,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,MAAM,EAAE,SAAS;AAClB,KAAA;AACF,CAAA,CAAC;AAMK,MAAM,WAAW,GAA+B,CAAC,EACtD,OAAO,EACP,OAAO,GACR,KAAI;AACH,IAAA,MAAM,OAAO,GAAG,SAAS,EAAE;AAC3B,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO;IAExB,QACEA,IAAA,CAAC,IAAI,EAAA,EAAA,QAAA,EAAA,CACHC,GAAA,CAAC,UAAU,EAAA,EACT,SAAS,EAAE,OAAO,CAAC,UAAU,EAC7B,KAAK,EACHD,IAAA,CAAC,GAAG,EAAA,EAAC,OAAO,EAAC,MAAM,EAAA,QAAA,EAAA,CACjBC,GAAA,CAAC,UAAU,EAAA,EAAC,OAAO,EAAC,OAAO,EAAC,UAAU,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAA,QAAA,EAC7D,IAAI,EAAE,IAAI,EAAA,CACA,EACbA,GAAA,CAAC,UAAU,EAAA,EAAC,OAAO,EAAC,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAA,QAAA,EACrC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAoB,CAAC,CAAC,CAAC,OAAO,EAAE,EAAA,CAC9C,CAAA,EAAA,CACT,EAER,MAAM,EACJA,IAAC,MAAM,EAAA,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAgB,EAAA,CAAI,EAExE,MAAM,EACJD,IAAA,CAAC,GAAG,EAAA,EACF,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,SAAS,EAAE,OAAO,CAAC,KAAK,EACxB,OAAO,EAAE,MAAK;wBACZ,OAAO,CAAC,OAAO,CAAC;oBAClB,CAAC,EAAA,QAAA,EAAA,CAEDC,IAAC,SAAS,EAAA,EAAC,KAAK,EAAC,SAAS,GAAG,EAC7BD,IAAA,CAAC,UAAU,EAAA,EAAC,OAAO,EAAC,OAAO,EAAC,UAAU,EAAE,GAAG,EAAE,KAAK,EAAC,SAAS,aACzD,GAAG,EAAA,WAAA,CAAA,EAAA,CAEO,IACT,EAAA,CAER,EACFC,IAAC,WAAW,EAAA,EAAA,QAAA,EACVA,aACE,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,OAAiB,EAAE,EAAA,CACzD,EAAA,CACK,CAAA,EAAA,CACT;AAEX;;;;"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { DialogDefault } from '../../../shared/components/dialog/DialogDefault.js';
|
|
3
|
-
import {
|
|
3
|
+
import { useStore } from '@cobuildlab/react-simple-state';
|
|
4
4
|
import { openSubscriptionCommentsStore } from '../comment.store.js';
|
|
5
5
|
import { openSubscriptionCommentsStoreAction } from '../comment.actions.js';
|
|
6
|
+
import { Box, Typography } from '@mui/material';
|
|
6
7
|
import { URL_PORTAL } from '../../../shared/constants/index.js';
|
|
7
|
-
import Box from '../../../node_modules/@mui/material/esm/Box/Box.js';
|
|
8
|
-
import Typography from '../../../node_modules/@mui/material/esm/Typography/Typography.js';
|
|
9
8
|
|
|
10
9
|
const CommentSubscriptionDialog = () => {
|
|
11
|
-
const { open } =
|
|
10
|
+
const { open } = useStore(openSubscriptionCommentsStore);
|
|
12
11
|
return (jsx(DialogDefault, { isOpen: open, showActions: true, handleClose: () => openSubscriptionCommentsStoreAction(false), successText: "SUSCRIBIRTE", handleSuccess: () => (window.location.href = `${URL_PORTAL}/planes`), children: jsx(Box, { px: 2, textAlign: "center", children: jsx(Typography, { fontSize: 20, fontWeight: 700, children: "Debes tener una suscripci\u00F3n activa para poder realizar un comentario" }) }) }));
|
|
13
12
|
};
|
|
14
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentSubscriptionDialog.js","sources":["../../../../../src/components/comment/components/CommentSubscriptionDialog.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { DialogDefault } from '../../../shared/components/dialog/DialogDefault';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { openSubscriptionCommentsStore } from '../comment.store';\nimport { openSubscriptionCommentsStoreAction } from '../comment.actions';\nimport { Typography, Box } from '@mui/material';\nimport {URL_PORTAL} from \"../../../shared/constants\";\n\nexport const CommentSubscriptionDialog: React.FC = () => {\n const { open } = useStore(openSubscriptionCommentsStore);\n return (\n <DialogDefault\n isOpen={open}\n showActions\n handleClose={() => openSubscriptionCommentsStoreAction(false)}\n successText=\"SUSCRIBIRTE\"\n handleSuccess={() =>\n (window.location.href = `${URL_PORTAL}/planes`)\n }\n >\n <Box px={2} textAlign=\"center\">\n <Typography fontSize={20} fontWeight={700}>\n Debes tener una suscripción activa para poder realizar un comentario\n </Typography>\n </Box>\n </DialogDefault>\n );\n};\n"],"names":["
|
|
1
|
+
{"version":3,"file":"CommentSubscriptionDialog.js","sources":["../../../../../src/components/comment/components/CommentSubscriptionDialog.tsx"],"sourcesContent":["\n\nimport React from 'react';\nimport { DialogDefault } from '../../../shared/components/dialog/DialogDefault';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { openSubscriptionCommentsStore } from '../comment.store';\nimport { openSubscriptionCommentsStoreAction } from '../comment.actions';\nimport { Typography, Box } from '@mui/material';\nimport {URL_PORTAL} from \"../../../shared/constants\";\n\nexport const CommentSubscriptionDialog: React.FC = () => {\n const { open } = useStore(openSubscriptionCommentsStore);\n return (\n <DialogDefault\n isOpen={open}\n showActions\n handleClose={() => openSubscriptionCommentsStoreAction(false)}\n successText=\"SUSCRIBIRTE\"\n handleSuccess={() =>\n (window.location.href = `${URL_PORTAL}/planes`)\n }\n >\n <Box px={2} textAlign=\"center\">\n <Typography fontSize={20} fontWeight={700}>\n Debes tener una suscripción activa para poder realizar un comentario\n </Typography>\n </Box>\n </DialogDefault>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;;;AAUO,MAAM,yBAAyB,GAAa,MAAK;IACtD,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,6BAA6B,CAAC;AACxD,IAAA,QACEA,GAAA,CAAC,aAAa,EAAA,EACZ,MAAM,EAAE,IAAI,EACZ,WAAW,EAAA,IAAA,EACX,WAAW,EAAE,MAAM,mCAAmC,CAAC,KAAK,CAAC,EAC7D,WAAW,EAAC,aAAa,EACzB,aAAa,EAAE,OACZ,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAA,EAAG,UAAU,CAAA,OAAA,CAAS,CAAC,EAAA,QAAA,EAGjDA,GAAA,CAAC,GAAG,EAAA,EAAC,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,QAAQ,EAAA,QAAA,EAC5BA,GAAA,CAAC,UAAU,EAAA,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAA,QAAA,EAAA,2EAAA,EAAA,CAE5B,EAAA,CACT,EAAA,CACQ;AAEpB;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Grid } from '@mui/material';
|
|
2
3
|
import { CommentItem } from './CommentItem.js';
|
|
3
|
-
import Grid from '../../../node_modules/@mui/material/esm/Grid/Grid.js';
|
|
4
4
|
|
|
5
5
|
const ReplyComments = ({ replyComments, onReply, }) => {
|
|
6
6
|
return (jsx(Grid, { container: true, spacing: 2, children: replyComments?.map((replyComment, key) => (jsx(Grid, { size: 12, children: jsx(CommentItem, { comment: replyComment, onReply: onReply }) }, key))) }));
|