@selfcommunity/react-ui 0.7.0-alpha.137 → 0.7.0-alpha.138
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/lib/cjs/components/CommentObject/CommentObject.d.ts +5 -5
- package/lib/cjs/components/CommentObject/CommentObject.d.ts.map +1 -1
- package/lib/cjs/components/CommentObject/CommentObject.js +14 -252
- package/lib/cjs/components/CommentObject/CommentObject.js.map +1 -1
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.d.ts +3 -3
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.d.ts.map +1 -1
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js +1 -1
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js.map +1 -1
- package/lib/cjs/components/CommentsObject/CommentsObject.d.ts +3 -3
- package/lib/cjs/components/CommentsObject/CommentsObject.d.ts.map +1 -1
- package/lib/cjs/components/CommentsObject/CommentsObject.js +1 -1
- package/lib/cjs/components/CommentsObject/CommentsObject.js.map +1 -1
- package/lib/cjs/components/Composer/Composer.d.ts +2 -2
- package/lib/cjs/components/Composer/Composer.d.ts.map +1 -1
- package/lib/cjs/components/Composer/Composer.js +1 -125
- package/lib/cjs/components/Composer/Composer.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Actions.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Actions.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Actions.js +4 -7
- package/lib/cjs/components/FeedObject/Actions/Actions.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Comment/Comment.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Comment/Comment.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Comment/Comment.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Comment/Comment.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/Share.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Share/Share.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Vote/Vote.d.ts +2 -18
- package/lib/cjs/components/FeedObject/Actions/Vote/Vote.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Vote/Vote.js +10 -277
- package/lib/cjs/components/FeedObject/Actions/Vote/Vote.js.map +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.d.ts +4 -4
- package/lib/cjs/components/FeedObject/Activities/Activities.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js.map +1 -1
- package/lib/cjs/components/FeedObject/Contributors/Contributors.d.ts +2 -2
- package/lib/cjs/components/FeedObject/Contributors/Contributors.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.d.ts +2 -2
- package/lib/cjs/components/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.js +8 -9
- package/lib/cjs/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/cjs/components/FeedObject/Poll/Poll.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Poll/Poll.js +1 -1
- package/lib/cjs/components/FeedObject/Poll/Poll.js.map +1 -1
- package/lib/cjs/components/InlineComposer/InlineComposer.d.ts.map +1 -1
- package/lib/cjs/components/InlineComposer/InlineComposer.js +1 -20
- package/lib/cjs/components/InlineComposer/InlineComposer.js.map +1 -1
- package/lib/cjs/components/Notification/Comment/Comment.d.ts +2 -12
- package/lib/cjs/components/Notification/Comment/Comment.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Comment/Comment.js +7 -12
- package/lib/cjs/components/Notification/Comment/Comment.js.map +1 -1
- package/lib/cjs/components/Notification/Contribution/Contribution.d.ts +2 -12
- package/lib/cjs/components/Notification/Contribution/Contribution.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Contribution/Contribution.js +11 -16
- package/lib/cjs/components/Notification/Contribution/Contribution.js.map +1 -1
- package/lib/cjs/components/Notification/Notification.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Notification.js +7 -33
- package/lib/cjs/components/Notification/Notification.js.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js.map +1 -1
- package/lib/cjs/components/PrivateMessageThread/Skeleton.js +2 -2
- package/lib/cjs/components/PrivateMessageThread/Skeleton.js.map +1 -1
- package/lib/cjs/components/PrivateMessageThreadItem/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/PrivateMessageThreadItem/Skeleton.js +2 -4
- package/lib/cjs/components/PrivateMessageThreadItem/Skeleton.js.map +1 -1
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.d.ts +2 -2
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.d.ts.map +1 -1
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.js.map +1 -1
- package/lib/cjs/components/User/User.d.ts +3 -8
- package/lib/cjs/components/User/User.d.ts.map +1 -1
- package/lib/cjs/components/User/User.js +6 -28
- package/lib/cjs/components/User/User.js.map +1 -1
- package/lib/cjs/components/UserInfoDialog/UserInfoDialog.d.ts +1 -1
- package/lib/cjs/components/UserInfoDialog/UserInfoDialog.d.ts.map +1 -1
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts +50 -0
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts.map +1 -0
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +174 -0
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js.map +1 -0
- package/lib/cjs/components/VoteAudienceButton/index.d.ts +4 -0
- package/lib/cjs/components/VoteAudienceButton/index.d.ts.map +1 -0
- package/lib/cjs/components/{CommentObject/Reactions/ReactionsDialog → VoteAudienceButton}/index.js +2 -2
- package/lib/cjs/components/VoteAudienceButton/index.js.map +1 -0
- package/lib/cjs/components/VoteButton/VoteButton.d.ts +53 -0
- package/lib/cjs/components/VoteButton/VoteButton.d.ts.map +1 -0
- package/lib/cjs/components/VoteButton/VoteButton.js +152 -0
- package/lib/cjs/components/VoteButton/VoteButton.js.map +1 -0
- package/lib/cjs/components/VoteButton/index.d.ts +4 -0
- package/lib/cjs/components/VoteButton/index.d.ts.map +1 -0
- package/lib/cjs/components/{FeedObject/Actions/Reaction → VoteButton}/index.js +2 -2
- package/lib/cjs/components/VoteButton/index.js.map +1 -0
- package/lib/cjs/shared/BaseDialog/BaseDialog.d.ts +11 -0
- package/lib/cjs/shared/BaseDialog/BaseDialog.d.ts.map +1 -1
- package/lib/cjs/shared/BaseDialog/BaseDialog.js +3 -8
- package/lib/cjs/shared/BaseDialog/BaseDialog.js.map +1 -1
- package/lib/cjs/shared/ContributionActionsMenu/index.d.ts +2 -2
- package/lib/cjs/shared/ContributionActionsMenu/index.d.ts.map +1 -1
- package/lib/cjs/shared/ContributionActionsMenu/index.js +14 -15
- package/lib/cjs/shared/ContributionActionsMenu/index.js.map +1 -1
- package/lib/cjs/utils/contribution.d.ts +2 -2
- package/lib/cjs/utils/contribution.d.ts.map +1 -1
- package/lib/cjs/utils/contribution.js +15 -17
- package/lib/cjs/utils/contribution.js.map +1 -1
- package/lib/esm/components/CommentObject/CommentObject.d.ts +5 -5
- package/lib/esm/components/CommentObject/CommentObject.d.ts.map +1 -1
- package/lib/esm/components/CommentObject/CommentObject.js +20 -258
- package/lib/esm/components/CommentObject/CommentObject.js.map +1 -1
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.d.ts +3 -3
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.d.ts.map +1 -1
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js +3 -3
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js.map +1 -1
- package/lib/esm/components/CommentsObject/CommentsObject.d.ts +3 -3
- package/lib/esm/components/CommentsObject/CommentsObject.d.ts.map +1 -1
- package/lib/esm/components/CommentsObject/CommentsObject.js +2 -2
- package/lib/esm/components/CommentsObject/CommentsObject.js.map +1 -1
- package/lib/esm/components/Composer/Composer.d.ts +2 -2
- package/lib/esm/components/Composer/Composer.d.ts.map +1 -1
- package/lib/esm/components/Composer/Composer.js +2 -126
- package/lib/esm/components/Composer/Composer.js.map +1 -1
- package/lib/esm/components/Editor/plugins/ImagePlugin.js +1 -1
- package/lib/esm/components/Editor/plugins/ImagePlugin.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Actions.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Actions.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Actions.js +6 -9
- package/lib/esm/components/FeedObject/Actions/Actions.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Comment/Comment.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Comment/Comment.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Comment/Comment.js +3 -3
- package/lib/esm/components/FeedObject/Actions/Comment/Comment.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.js +3 -3
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Share/Share.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Share/Share.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +2 -2
- package/lib/esm/components/FeedObject/Actions/Share/Share.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts +2 -2
- package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js +2 -2
- package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Vote/Vote.d.ts +2 -18
- package/lib/esm/components/FeedObject/Actions/Vote/Vote.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Vote/Vote.js +12 -255
- package/lib/esm/components/FeedObject/Actions/Vote/Vote.js.map +1 -1
- package/lib/esm/components/FeedObject/Activities/Activities.d.ts +4 -4
- package/lib/esm/components/FeedObject/Activities/Activities.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Activities/Activities.js +2 -2
- package/lib/esm/components/FeedObject/Activities/Activities.js.map +1 -1
- package/lib/esm/components/FeedObject/Contributors/Contributors.d.ts +2 -2
- package/lib/esm/components/FeedObject/Contributors/Contributors.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/FeedObject.d.ts +2 -2
- package/lib/esm/components/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/FeedObject.js +10 -11
- package/lib/esm/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/esm/components/FeedObject/Poll/Poll.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Poll/Poll.js +2 -2
- package/lib/esm/components/FeedObject/Poll/Poll.js.map +1 -1
- package/lib/esm/components/InlineComposer/InlineComposer.d.ts.map +1 -1
- package/lib/esm/components/InlineComposer/InlineComposer.js +1 -20
- package/lib/esm/components/InlineComposer/InlineComposer.js.map +1 -1
- package/lib/esm/components/Notification/Comment/Comment.d.ts +2 -12
- package/lib/esm/components/Notification/Comment/Comment.d.ts.map +1 -1
- package/lib/esm/components/Notification/Comment/Comment.js +9 -14
- package/lib/esm/components/Notification/Comment/Comment.js.map +1 -1
- package/lib/esm/components/Notification/Contribution/Contribution.d.ts +2 -12
- package/lib/esm/components/Notification/Contribution/Contribution.d.ts.map +1 -1
- package/lib/esm/components/Notification/Contribution/Contribution.js +13 -18
- package/lib/esm/components/Notification/Contribution/Contribution.js.map +1 -1
- package/lib/esm/components/Notification/Notification.d.ts.map +1 -1
- package/lib/esm/components/Notification/Notification.js +7 -33
- package/lib/esm/components/Notification/Notification.js.map +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js.map +1 -1
- package/lib/esm/components/PrivateMessageThread/Skeleton.js +2 -2
- package/lib/esm/components/PrivateMessageThread/Skeleton.js.map +1 -1
- package/lib/esm/components/PrivateMessageThreadItem/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/PrivateMessageThreadItem/Skeleton.js +2 -4
- package/lib/esm/components/PrivateMessageThreadItem/Skeleton.js.map +1 -1
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.d.ts +2 -2
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.d.ts.map +1 -1
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.js.map +1 -1
- package/lib/esm/components/User/User.d.ts +3 -8
- package/lib/esm/components/User/User.d.ts.map +1 -1
- package/lib/esm/components/User/User.js +6 -28
- package/lib/esm/components/User/User.js.map +1 -1
- package/lib/esm/components/UserInfoDialog/UserInfoDialog.d.ts +1 -1
- package/lib/esm/components/UserInfoDialog/UserInfoDialog.d.ts.map +1 -1
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts +50 -0
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts.map +1 -0
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +145 -0
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js.map +1 -0
- package/lib/esm/components/VoteAudienceButton/index.d.ts +4 -0
- package/lib/esm/components/VoteAudienceButton/index.d.ts.map +1 -0
- package/lib/esm/components/VoteAudienceButton/index.js +3 -0
- package/lib/esm/components/VoteAudienceButton/index.js.map +1 -0
- package/lib/esm/components/VoteButton/VoteButton.d.ts +53 -0
- package/lib/esm/components/VoteButton/VoteButton.d.ts.map +1 -0
- package/lib/esm/components/VoteButton/VoteButton.js +123 -0
- package/lib/esm/components/VoteButton/VoteButton.js.map +1 -0
- package/lib/esm/components/VoteButton/index.d.ts +4 -0
- package/lib/esm/components/VoteButton/index.d.ts.map +1 -0
- package/lib/esm/components/VoteButton/index.js +3 -0
- package/lib/esm/components/VoteButton/index.js.map +1 -0
- package/lib/esm/shared/BaseDialog/BaseDialog.d.ts +11 -0
- package/lib/esm/shared/BaseDialog/BaseDialog.d.ts.map +1 -1
- package/lib/esm/shared/BaseDialog/BaseDialog.js +3 -8
- package/lib/esm/shared/BaseDialog/BaseDialog.js.map +1 -1
- package/lib/esm/shared/ContributionActionsMenu/index.d.ts +2 -2
- package/lib/esm/shared/ContributionActionsMenu/index.d.ts.map +1 -1
- package/lib/esm/shared/ContributionActionsMenu/index.js +12 -13
- package/lib/esm/shared/ContributionActionsMenu/index.js.map +1 -1
- package/lib/esm/utils/contribution.d.ts +2 -2
- package/lib/esm/utils/contribution.d.ts.map +1 -1
- package/lib/esm/utils/contribution.js +16 -18
- package/lib/esm/utils/contribution.js.map +1 -1
- package/lib/umd/react-ui.js +11 -11
- package/lib/umd/react-ui.js.LICENSE.txt +1 -1
- package/lib/umd/react-ui.js.map +1 -1
- package/package.json +6 -6
- package/lib/cjs/components/CommentObject/Reactions/Reactions.d.ts +0 -23
- package/lib/cjs/components/CommentObject/Reactions/Reactions.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/Reactions.js +0 -97
- package/lib/cjs/components/CommentObject/Reactions/Reactions.js.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts +0 -34
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js +0 -129
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/index.d.ts +0 -4
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/index.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/index.js.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/index.d.ts +0 -4
- package/lib/cjs/components/CommentObject/Reactions/index.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Reactions/index.js +0 -8
- package/lib/cjs/components/CommentObject/Reactions/index.js.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/Votes.d.ts +0 -19
- package/lib/cjs/components/CommentObject/Votes/Votes.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/Votes.js +0 -93
- package/lib/cjs/components/CommentObject/Votes/Votes.js.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts +0 -24
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.js +0 -95
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.js.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.d.ts +0 -4
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.js +0 -8
- package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.js.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/index.d.ts +0 -4
- package/lib/cjs/components/CommentObject/Votes/index.d.ts.map +0 -1
- package/lib/cjs/components/CommentObject/Votes/index.js +0 -8
- package/lib/cjs/components/CommentObject/Votes/index.js.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.d.ts +0 -34
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.d.ts.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.js +0 -474
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.js.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts +0 -40
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.js +0 -156
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.js.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/index.d.ts +0 -3
- package/lib/cjs/components/FeedObject/Actions/Reaction/index.d.ts.map +0 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/index.js.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/Reactions.d.ts +0 -23
- package/lib/esm/components/CommentObject/Reactions/Reactions.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/Reactions.js +0 -68
- package/lib/esm/components/CommentObject/Reactions/Reactions.js.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts +0 -34
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js +0 -100
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.d.ts +0 -4
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.js +0 -3
- package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.js.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/index.d.ts +0 -4
- package/lib/esm/components/CommentObject/Reactions/index.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Reactions/index.js +0 -3
- package/lib/esm/components/CommentObject/Reactions/index.js.map +0 -1
- package/lib/esm/components/CommentObject/Votes/Votes.d.ts +0 -19
- package/lib/esm/components/CommentObject/Votes/Votes.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Votes/Votes.js +0 -64
- package/lib/esm/components/CommentObject/Votes/Votes.js.map +0 -1
- package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts +0 -24
- package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.js +0 -66
- package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.js.map +0 -1
- package/lib/esm/components/CommentObject/Votes/VotesDialog/index.d.ts +0 -4
- package/lib/esm/components/CommentObject/Votes/VotesDialog/index.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Votes/VotesDialog/index.js +0 -3
- package/lib/esm/components/CommentObject/Votes/VotesDialog/index.js.map +0 -1
- package/lib/esm/components/CommentObject/Votes/index.d.ts +0 -4
- package/lib/esm/components/CommentObject/Votes/index.d.ts.map +0 -1
- package/lib/esm/components/CommentObject/Votes/index.js +0 -3
- package/lib/esm/components/CommentObject/Votes/index.js.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.d.ts +0 -34
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.d.ts.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.js +0 -444
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.js.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts +0 -40
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.js +0 -127
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.js.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/index.d.ts +0 -3
- package/lib/esm/components/FeedObject/Actions/Reaction/index.d.ts.map +0 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/index.js +0 -3
- package/lib/esm/components/FeedObject/Actions/Reaction/index.js.map +0 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
13
|
+
import { styled } from '@mui/material/styles';
|
|
14
|
+
import { LoadingButton } from '@mui/lab';
|
|
15
|
+
import classNames from 'classnames';
|
|
16
|
+
import { useThemeProps } from '@mui/system';
|
|
17
|
+
import Icon from '@mui/material/Icon';
|
|
18
|
+
import { Avatar, Box, List, ListItem, Tab, Tabs, Typography } from '@mui/material';
|
|
19
|
+
import { FormattedMessage } from 'react-intl';
|
|
20
|
+
import { useSCFetchVote, useSCUser } from '@selfcommunity/react-core';
|
|
21
|
+
import BaseDialog from '../../shared/BaseDialog';
|
|
22
|
+
import CentralProgress from '../../shared/CentralProgress';
|
|
23
|
+
import InfiniteScroll from '../../shared/InfiniteScroll';
|
|
24
|
+
import User from '../User';
|
|
25
|
+
const PREFIX = 'SCVoteAudienceButton';
|
|
26
|
+
const classes = {
|
|
27
|
+
root: `${PREFIX}-root`,
|
|
28
|
+
reactionList: `${PREFIX}-reaction-list`,
|
|
29
|
+
dialogRoot: `${PREFIX}-dialog-root`,
|
|
30
|
+
dialogTabs: `${PREFIX}-dialog-tabs`,
|
|
31
|
+
dialogVoteBadge: `${PREFIX}-dialog-vote-badge`
|
|
32
|
+
};
|
|
33
|
+
const Root = styled(LoadingButton, {
|
|
34
|
+
name: PREFIX,
|
|
35
|
+
slot: 'Root',
|
|
36
|
+
overridesResolver: (props, styles) => [styles.root, styles.voted]
|
|
37
|
+
})(({ theme }) => ({}));
|
|
38
|
+
const DialogRoot = styled(BaseDialog, {
|
|
39
|
+
name: PREFIX,
|
|
40
|
+
slot: 'Root',
|
|
41
|
+
overridesResolver: (props, styles) => styles.dialogRoot
|
|
42
|
+
})(({ theme }) => ({}));
|
|
43
|
+
/**
|
|
44
|
+
* > API documentation for the Community-JS Vote Audience Button component. Learn about the available props and the CSS API.
|
|
45
|
+
|
|
46
|
+
#### Import
|
|
47
|
+
|
|
48
|
+
```jsx
|
|
49
|
+
import {VoteAudienceButton} from '@selfcommunity/react-ui';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Component Name
|
|
53
|
+
|
|
54
|
+
The name `SCVoteAudienceButton` can be used when providing style overrides in the theme.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
#### CSS
|
|
58
|
+
|
|
59
|
+
|Rule Name|Global class|Description|
|
|
60
|
+
|---|---|---|
|
|
61
|
+
|root|.SCVoteAudienceButton-root|Styles applied to the root element.|
|
|
62
|
+
|reactionList|.SCVoteAudienceButton-reactions|Styles applied to the reactionList list element.|
|
|
63
|
+
|dialogRoot|.SCVoteAudienceButton-dialog-root|Styles applied to the dialog root element.|
|
|
64
|
+
|dialogTabs|.SCVoteAudienceButton-dialog-tabs|Styles applied to the tabs element.|
|
|
65
|
+
|dialogVoteBadge|.SCVoteAudienceButton-dialog-vote-badge|Styles applied to the vote badge element.|
|
|
66
|
+
* @param inProps
|
|
67
|
+
*/
|
|
68
|
+
export default function VoteAudienceButton(inProps) {
|
|
69
|
+
// PROPS
|
|
70
|
+
const props = useThemeProps({
|
|
71
|
+
props: inProps,
|
|
72
|
+
name: PREFIX
|
|
73
|
+
});
|
|
74
|
+
const { className, contributionId = null, contributionType = null, contribution = null } = props, rest = __rest(props, ["className", "contributionId", "contributionType", "contribution"]);
|
|
75
|
+
// STATE
|
|
76
|
+
const [open, setOpen] = useState(false);
|
|
77
|
+
const [tab, setTab] = useState(0);
|
|
78
|
+
// CONTEXT
|
|
79
|
+
const scUserContext = useSCUser();
|
|
80
|
+
// HANDLERS
|
|
81
|
+
const handleOpen = (event) => {
|
|
82
|
+
setOpen(true);
|
|
83
|
+
};
|
|
84
|
+
const handleClose = (event) => {
|
|
85
|
+
setOpen(false);
|
|
86
|
+
};
|
|
87
|
+
const handleChangeTab = (event, newValue) => {
|
|
88
|
+
setTab(newValue);
|
|
89
|
+
};
|
|
90
|
+
// HOOKS
|
|
91
|
+
const { isLoading, contributionVoted, contributionVoteCount, contributionReactionsCount, reactions, error, handleFetchVoteList, voteList, isLoadingVoteList, voteListHasNext } = useSCFetchVote({
|
|
92
|
+
id: contributionId,
|
|
93
|
+
contributionType,
|
|
94
|
+
contribution
|
|
95
|
+
});
|
|
96
|
+
// EFFECTS
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!isLoadingVoteList && open) {
|
|
99
|
+
handleFetchVoteList({ reset: true });
|
|
100
|
+
}
|
|
101
|
+
}, [open]);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (isLoadingVoteList || !open) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (tab === 0) {
|
|
107
|
+
handleFetchVoteList({ reset: true });
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const { reaction } = contributionReactionsCount[tab - 1];
|
|
111
|
+
handleFetchVoteList({ reaction, reset: true });
|
|
112
|
+
}, [tab]);
|
|
113
|
+
// RENDER
|
|
114
|
+
const audienceIcon = useMemo(() => {
|
|
115
|
+
if (reactions.default && !isLoading && !error) {
|
|
116
|
+
return (React.createElement(Box, { className: classes.reactionList }, contributionReactionsCount.slice(0, 3).map((count, i) => (React.createElement(Icon, { key: count.reaction.id },
|
|
117
|
+
React.createElement("img", { alt: count.reaction.label, src: count.reaction.image, width: "100%", height: "100%" }))))));
|
|
118
|
+
}
|
|
119
|
+
return scUserContext.user && contributionVoted ? React.createElement(Icon, null, "thumb_up") : React.createElement(Icon, null, "thumb_up_off_alt");
|
|
120
|
+
}, [reactions.default, isLoading, error, contributionReactionsCount, scUserContext.user, contributionVoted]);
|
|
121
|
+
const dialogTitle = useMemo(() => {
|
|
122
|
+
if (reactions.default && !isLoading) {
|
|
123
|
+
return (React.createElement(Tabs, { className: classes.dialogTabs, value: tab, onChange: handleChangeTab, "aria-label": "reactions" },
|
|
124
|
+
React.createElement(Tab, { label: React.createElement(FormattedMessage, { defaultMessage: "ui.voteAudienceButton.dialog.tab.all", id: "ui.voteAudienceButton.dialog.tab.all" }) }),
|
|
125
|
+
contributionReactionsCount.map((count) => React.createElement(Tab, { key: count.reaction.id, label: React.createElement(React.Fragment, null,
|
|
126
|
+
React.createElement(Icon, null,
|
|
127
|
+
React.createElement("img", { alt: count.reaction.label, src: count.reaction.image, width: "100%", height: "100%" })),
|
|
128
|
+
count.count) }))));
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return React.createElement(FormattedMessage, { defaultMessage: "ui.voteAudienceButton.dialog.title", id: "ui.voteAudienceButton.dialog.title" });
|
|
132
|
+
}
|
|
133
|
+
}, [tab, reactions, contributionReactionsCount]);
|
|
134
|
+
return (React.createElement(React.Fragment, null,
|
|
135
|
+
React.createElement(Root, Object.assign({ onClick: handleOpen, disabled: isLoading || Boolean(error) || contributionVoteCount === 0, loading: isLoading, className: classNames(classes.root, className) }, rest),
|
|
136
|
+
audienceIcon,
|
|
137
|
+
"\u00A0",
|
|
138
|
+
scUserContext.user && contributionVoted ? (contributionVoteCount === 1 ? (React.createElement(FormattedMessage, { id: "ui.voteAudienceButton.votedOnlyByMe", defaultMessage: "ui.voteAudienceButton.votedOnlyByMe" })) : (React.createElement(FormattedMessage, { id: "ui.voteAudienceButton.votedByMe", defaultMessage: "ui.voteAudienceButton.votedByMe", values: { total: contributionVoteCount - 1 } }))) : (React.createElement(FormattedMessage, { id: "ui.voteAudienceButton.votes", defaultMessage: "ui.voteAudienceButton.votes", values: { total: contributionVoteCount } }))),
|
|
139
|
+
open && (React.createElement(DialogRoot, { title: dialogTitle, onClose: handleClose, open: open, DialogContentProps: {} }, isLoadingVoteList ? (React.createElement(CentralProgress, { size: 50 })) : (React.createElement(InfiniteScroll, { dataLength: voteList.length, next: () => handleFetchVoteList({}), hasMoreNext: voteListHasNext, loaderNext: React.createElement(CentralProgress, { size: 30 }), height: 400, endMessage: React.createElement(Typography, null,
|
|
140
|
+
React.createElement(FormattedMessage, { id: "ui.voteAudienceButton.dialog.end", defaultMessage: "ui.voteAudienceButton.dialog.end" })) },
|
|
141
|
+
React.createElement(List, null, voteList.map((vote) => (React.createElement(ListItem, { key: vote.user.id },
|
|
142
|
+
React.createElement(User, { elevation: 0, user: vote.user, badgeContent: React.createElement(Avatar, { className: classes.dialogVoteBadge }, vote.reaction ? (React.createElement(Icon, null,
|
|
143
|
+
React.createElement("img", { alt: vote.reaction.label, src: vote.reaction.image, width: "100%", height: "100%" }))) : (React.createElement(Icon, null, "thumb_up"))) })))))))))));
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=VoteAudienceButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoteAudienceButton.js","sourceRoot":"","sources":["../../../../src/components/VoteAudienceButton/VoteAudienceButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAqB,MAAM,UAAU,CAAC;AAC3D,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAmC,cAAc,EAAE,SAAS,EAAC,MAAM,2BAA2B,CAAC;AACtG,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,MAAM,MAAM,GAAG,sBAAsB,CAAC;AAEtC,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;IACtB,YAAY,EAAE,GAAG,MAAM,gBAAgB;IACvC,UAAU,EAAE,GAAG,MAAM,cAAc;IACnC,UAAU,EAAE,GAAG,MAAM,cAAc;IACnC,eAAe,EAAE,GAAG,MAAM,oBAAoB;CAC/C,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa,EAAE;IACjC,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAA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AAA,OAAO,kBAAkB,EAAE,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAC;AACjF,eAAe,kBAAkB,CAAC;AAClC,OAAO,EAAC,uBAAuB,EAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/VoteAudienceButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAA6C,MAAM,sBAAsB,CAAC;AACjF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { LoadingButtonProps } from '@mui/lab';
|
|
2
|
+
import { SCCommentType, SCContributionType, SCFeedObjectType } from '@selfcommunity/types';
|
|
3
|
+
export interface VoteButtonProps extends Pick<LoadingButtonProps, Exclude<keyof LoadingButtonProps, 'onClick' | 'disabled' | 'loading'>> {
|
|
4
|
+
/**
|
|
5
|
+
* Id of the contribution object to vote
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
contributionId: number;
|
|
9
|
+
/**
|
|
10
|
+
* Type of the contribution object to vote
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
contributionType: SCContributionType | any;
|
|
14
|
+
/**
|
|
15
|
+
* Contribution object to vote
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
contribution?: SCFeedObjectType | SCCommentType | null;
|
|
19
|
+
/**
|
|
20
|
+
* onVote callback
|
|
21
|
+
* @default null
|
|
22
|
+
*/
|
|
23
|
+
onVote?: (contribution: SCFeedObjectType | SCCommentType) => any;
|
|
24
|
+
/**
|
|
25
|
+
* Others properties
|
|
26
|
+
*/
|
|
27
|
+
[p: string]: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* > API documentation for the Community-JS Vote Button component. Learn about the available props and the CSS API.
|
|
31
|
+
|
|
32
|
+
#### Import
|
|
33
|
+
|
|
34
|
+
```jsx
|
|
35
|
+
import {VoteAudienceButton} from '@selfcommunity/react-ui';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Component Name
|
|
39
|
+
|
|
40
|
+
The name `SCVoteButton` can be used when providing style overrides in the theme.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
#### CSS
|
|
44
|
+
|
|
45
|
+
|Rule Name|Global class|Description|
|
|
46
|
+
|---|---|---|
|
|
47
|
+
|root|.SCVoteButton-root|Styles applied to the root element.|
|
|
48
|
+
|voted|.SCVoteButton-voted|Styles applied to the root element when the user has vote the contribution.|
|
|
49
|
+
|
|
50
|
+
* @param inProps
|
|
51
|
+
*/
|
|
52
|
+
export default function VoteButton(inProps: VoteButtonProps): JSX.Element;
|
|
53
|
+
//# sourceMappingURL=VoteButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoteButton.d.ts","sourceRoot":"","sources":["../../../../src/components/VoteButton/VoteButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAiB,MAAM,sBAAsB,CAAC;AA6BzG,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,MAAM,kBAAkB,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;IACtI;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,gBAAgB,EAAE,kBAAkB,GAAG,GAAG,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG,IAAI,CAAC;IAEvD;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,gBAAgB,GAAG,aAAa,KAAK,GAAG,CAAC;IAEjE;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAsHxE"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
13
|
+
import { styled } from '@mui/material/styles';
|
|
14
|
+
import { LoadingButton } from '@mui/lab';
|
|
15
|
+
import classNames from 'classnames';
|
|
16
|
+
import { useThemeProps } from '@mui/system';
|
|
17
|
+
import Icon from '@mui/material/Icon';
|
|
18
|
+
import { IconButton, Paper, Popper, Tooltip } from '@mui/material';
|
|
19
|
+
import { useSCFetchVote, useSCUser } from '@selfcommunity/react-core';
|
|
20
|
+
import { FormattedMessage } from 'react-intl';
|
|
21
|
+
const PREFIX = 'SCVoteButton';
|
|
22
|
+
const classes = {
|
|
23
|
+
root: `${PREFIX}-root`,
|
|
24
|
+
voted: `${PREFIX}-voted`,
|
|
25
|
+
popperRoot: `${PREFIX}-popper-root`,
|
|
26
|
+
reactionList: `${PREFIX}-reaction-list`,
|
|
27
|
+
reaction: `${PREFIX}-reaction`
|
|
28
|
+
};
|
|
29
|
+
const Root = styled(LoadingButton, {
|
|
30
|
+
name: PREFIX,
|
|
31
|
+
slot: 'Root',
|
|
32
|
+
overridesResolver: (props, styles) => [styles.root, styles.voted]
|
|
33
|
+
})(({ theme }) => ({}));
|
|
34
|
+
const PopperRoot = styled(Popper, {
|
|
35
|
+
name: PREFIX,
|
|
36
|
+
slot: 'Root',
|
|
37
|
+
overridesResolver: (props, styles) => styles.popperRoot
|
|
38
|
+
})(({ theme }) => ({}));
|
|
39
|
+
/**
|
|
40
|
+
* > API documentation for the Community-JS Vote Button component. Learn about the available props and the CSS API.
|
|
41
|
+
|
|
42
|
+
#### Import
|
|
43
|
+
|
|
44
|
+
```jsx
|
|
45
|
+
import {VoteAudienceButton} from '@selfcommunity/react-ui';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### Component Name
|
|
49
|
+
|
|
50
|
+
The name `SCVoteButton` can be used when providing style overrides in the theme.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
#### CSS
|
|
54
|
+
|
|
55
|
+
|Rule Name|Global class|Description|
|
|
56
|
+
|---|---|---|
|
|
57
|
+
|root|.SCVoteButton-root|Styles applied to the root element.|
|
|
58
|
+
|voted|.SCVoteButton-voted|Styles applied to the root element when the user has vote the contribution.|
|
|
59
|
+
|
|
60
|
+
* @param inProps
|
|
61
|
+
*/
|
|
62
|
+
export default function VoteButton(inProps) {
|
|
63
|
+
// PROPS
|
|
64
|
+
const props = useThemeProps({
|
|
65
|
+
props: inProps,
|
|
66
|
+
name: PREFIX
|
|
67
|
+
});
|
|
68
|
+
const { className, contributionId = null, contributionType = null, contribution = null, onVote } = props, rest = __rest(props, ["className", "contributionId", "contributionType", "contribution", "onVote"]);
|
|
69
|
+
// STATE
|
|
70
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
71
|
+
// REF
|
|
72
|
+
const timeoutRef = useRef(null);
|
|
73
|
+
// CONTEXT
|
|
74
|
+
const scUserContext = useSCUser();
|
|
75
|
+
// HANDLERS
|
|
76
|
+
const handleMouseEnter = (event) => {
|
|
77
|
+
handleClearTimeout();
|
|
78
|
+
setTimeout(() => setAnchorEl(event.target), 1000);
|
|
79
|
+
};
|
|
80
|
+
const handleMouseLeave = (event) => {
|
|
81
|
+
timeoutRef.current = setTimeout(() => setAnchorEl(null), 500);
|
|
82
|
+
};
|
|
83
|
+
const handleClearTimeout = () => {
|
|
84
|
+
timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
85
|
+
timeoutRef.current = null;
|
|
86
|
+
};
|
|
87
|
+
const handleVoteDone = (contribution) => {
|
|
88
|
+
setAnchorEl(null);
|
|
89
|
+
onVote && onVote(contribution);
|
|
90
|
+
};
|
|
91
|
+
// HOOKS
|
|
92
|
+
const { isLoading, isVoting, contributionVoted, contributionReaction, reactions, handleVote, error } = useSCFetchVote({
|
|
93
|
+
id: contributionId,
|
|
94
|
+
contributionType,
|
|
95
|
+
contribution,
|
|
96
|
+
onVote: handleVoteDone
|
|
97
|
+
});
|
|
98
|
+
// MEMO
|
|
99
|
+
const rootProps = useMemo(() => {
|
|
100
|
+
if (!reactions.default) {
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
onMouseEnter: handleMouseEnter,
|
|
105
|
+
onMouseLeave: handleMouseLeave,
|
|
106
|
+
onTouchStart: handleMouseEnter,
|
|
107
|
+
onTouchMove: handleMouseLeave
|
|
108
|
+
};
|
|
109
|
+
}, [reactions]);
|
|
110
|
+
// RENDER
|
|
111
|
+
const button = (React.createElement(Root, Object.assign({ onClick: () => handleVote(contributionReaction ? contributionReaction : reactions.default ? reactions.default : null), disabled: isLoading || Boolean(error), loading: isVoting, className: classNames(classes.root, className, {
|
|
112
|
+
[classes.voted]: scUserContext.user && contributionVoted
|
|
113
|
+
}) }, rest, rootProps), scUserContext.user && contributionVoted ? (contributionReaction ? (React.createElement(Icon, null,
|
|
114
|
+
React.createElement("img", { alt: contributionReaction.label, src: contributionReaction.image, width: "100%", height: "100%" }))) : (React.createElement(Icon, null, "thumb_up"))) : (React.createElement(Icon, null, "thumb_up_off_alt"))));
|
|
115
|
+
return (React.createElement(React.Fragment, null,
|
|
116
|
+
reactions.default ? (button) : (React.createElement(Tooltip, { title: contributionVoted ? (React.createElement(FormattedMessage, { id: "ui.voteButton.voteDown", defaultMessage: "ui.voteButton.voteDown" })) : (React.createElement(FormattedMessage, { id: "ui.voteButton.voteUp", defaultMessage: "ui.voteButton.voteUp" })) },
|
|
117
|
+
React.createElement("span", null, button))),
|
|
118
|
+
reactions.default && (React.createElement(PopperRoot, { id: `vote_${contributionId}_${contributionType}_popper`, className: classes.popperRoot, open: Boolean(anchorEl) && !isVoting && !isLoading, anchorEl: anchorEl, placement: "top", keepMounted: true },
|
|
119
|
+
React.createElement(Paper, { className: classes.reactionList, onMouseEnter: handleClearTimeout, onMouseLeave: handleMouseLeave }, reactions.reactions.map((reaction) => (React.createElement(IconButton, { key: reaction.id, className: classes.reaction, onClick: () => handleVote(reaction) },
|
|
120
|
+
React.createElement(Icon, null,
|
|
121
|
+
React.createElement("img", { alt: reaction.label, src: reaction.image, width: "100%", height: "100%" }))))))))));
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=VoteButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoteButton.js","sourceRoot":"","sources":["../../../../src/components/VoteButton/VoteButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAqB,MAAM,UAAU,CAAC;AAC3D,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAoB,cAAc,EAAE,SAAS,EAAC,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAC,gBAAgB,E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eAAe,EAAC,MAAM,cAAc,CAAC;AACzD,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/VoteButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAA6B,MAAM,cAAc,CAAC;AACzD,eAAe,UAAU,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DialogContentProps } from '@mui/material/DialogContent';
|
|
1
3
|
export interface BaseDialogProps {
|
|
2
4
|
/**
|
|
3
5
|
* Overrides or extends the styles applied to the component.
|
|
@@ -14,6 +16,11 @@ export interface BaseDialogProps {
|
|
|
14
16
|
* @default ''
|
|
15
17
|
*/
|
|
16
18
|
subtitle?: any;
|
|
19
|
+
/**
|
|
20
|
+
* Dialog content props
|
|
21
|
+
* @default {dividers: !isMobile}
|
|
22
|
+
*/
|
|
23
|
+
DialogContentProps?: DialogContentProps;
|
|
17
24
|
/**
|
|
18
25
|
* Handles dialog opening
|
|
19
26
|
* @default false
|
|
@@ -24,6 +31,10 @@ export interface BaseDialogProps {
|
|
|
24
31
|
* @default null
|
|
25
32
|
*/
|
|
26
33
|
onClose?: () => any;
|
|
34
|
+
/**
|
|
35
|
+
* Actions for the dialog
|
|
36
|
+
*/
|
|
37
|
+
actions?: ReactNode;
|
|
27
38
|
/**
|
|
28
39
|
* Any other properties
|
|
29
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDialog.d.ts","sourceRoot":"","sources":["../../../../src/shared/BaseDialog/BaseDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseDialog.d.ts","sourceRoot":"","sources":["../../../../src/shared/BaseDialog/BaseDialog.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAKvC,OAAsB,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AA8B9E,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,eAqCxD"}
|
|
@@ -11,11 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { styled } from '@mui/material/styles';
|
|
14
|
-
import Button from '@mui/material/Button';
|
|
15
14
|
import Dialog from '@mui/material/Dialog';
|
|
16
15
|
import DialogActions from '@mui/material/DialogActions';
|
|
17
16
|
import DialogContent from '@mui/material/DialogContent';
|
|
18
|
-
import { FormattedMessage } from 'react-intl';
|
|
19
17
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
20
18
|
import Title from './title';
|
|
21
19
|
import classNames from 'classnames';
|
|
@@ -43,8 +41,7 @@ export default function BaseDialog(props) {
|
|
|
43
41
|
// PROPS
|
|
44
42
|
const theme = useTheme();
|
|
45
43
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
46
|
-
const { className, title = '', subtitle = null, open = false, onClose = null } = props, rest = __rest(props, ["className", "title", "subtitle", "open", "onClose"]);
|
|
47
|
-
const { children } = rest;
|
|
44
|
+
const { className = '', title = '', subtitle = null, DialogContentProps = { dividers: !isMobile }, open = false, onClose = null, actions = null, children } = props, rest = __rest(props, ["className", "title", "subtitle", "DialogContentProps", "open", "onClose", "actions", "children"]);
|
|
48
45
|
// OPTIONS
|
|
49
46
|
const fullScreen = useMediaQuery((theme) => theme['breakpoints'].down('sm'), { noSsr: typeof window !== 'undefined' });
|
|
50
47
|
/**
|
|
@@ -53,9 +50,7 @@ export default function BaseDialog(props) {
|
|
|
53
50
|
return (React.createElement(Root, { className: classNames(classes.root, className), fullScreen: fullScreen, fullWidth: true, open: open, onClose: onClose, maxWidth: rest.maxWidth ? rest.maxWidth : 'sm', scroll: "body" },
|
|
54
51
|
React.createElement(Title, { onClose: onClose }, title),
|
|
55
52
|
subtitle && subtitle,
|
|
56
|
-
React.createElement(DialogContent, {
|
|
57
|
-
|
|
58
|
-
React.createElement(Button, { onClick: onClose, color: "primary", autoFocus: true, variant: 'outlined' },
|
|
59
|
-
React.createElement(FormattedMessage, { id: "ui.baseDialog.button.close", defaultMessage: "ui.baseDialog.button.close" }))))));
|
|
53
|
+
React.createElement(DialogContent, Object.assign({}, DialogContentProps), children),
|
|
54
|
+
actions && React.createElement(DialogActions, null, actions)));
|
|
60
55
|
}
|
|
61
56
|
//# sourceMappingURL=BaseDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDialog.js","sourceRoot":"","sources":["../../../../src/shared/BaseDialog/BaseDialog.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BaseDialog.js","sourceRoot":"","sources":["../../../../src/shared/BaseDialog/BaseDialog.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAE5C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,aAAmC,MAAM,6BAA6B,CAAC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AAK,EADJ,IAAI,UACL,KAAK,EAVH,kGAUL,CAAQ,CAAC;IAEV,UAAU;IACV,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAC,KAAK,EAAE,OAAO,MAAM,KAAK,WAAW,EAAC,CAAC,CAAC;IAErH;;OAEG;IACH,OAAO,CACL,oBAAC,IAAI,IACH,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,EAC9C,UAAU,EAAE,UAAU,EACtB,SAAS,QACT,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAC9C,MAAM,EAAC,MAAM;QACb,oBAAC,KAAK,IAAC,OAAO,EAAE,OAAO,IAAG,KAAK,CAAS;QACvC,QAAQ,IAAI,QAAQ;QACrB,oBAAC,aAAa,oBAAK,kBAAkB,GAAG,QAAQ,CAAiB;QAChE,OAAO,IAAI,oBAAC,aAAa,QAAE,OAAO,CAAiB,CAC/C,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SCCommentType,
|
|
1
|
+
import { SCCommentType, SCContributionType, SCFeedObjectType } from '@selfcommunity/types';
|
|
2
2
|
export interface ContributionActionsMenuProps {
|
|
3
3
|
/**
|
|
4
4
|
* Overrides or extends the styles applied to the component.
|
|
@@ -19,7 +19,7 @@ export interface ContributionActionsMenuProps {
|
|
|
19
19
|
* Feed obj type
|
|
20
20
|
* @default 'post'
|
|
21
21
|
*/
|
|
22
|
-
feedObjectType?:
|
|
22
|
+
feedObjectType?: Exclude<SCContributionType, SCContributionType.COMMENT>;
|
|
23
23
|
/**
|
|
24
24
|
* CommentObject id
|
|
25
25
|
* @default null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/ContributionActionsMenu/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/ContributionActionsMenu/index.tsx"],"names":[],"mappings":"AAuDA,OAAO,EAAC,aAAa,EAAyB,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAyHhH,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEzE;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,GAAG,gBAAgB,KAAK,IAAI,CAAC;IAErE;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,GAAG,gBAAgB,KAAK,IAAI,CAAC;IAErE;;OAEG;IACH,oBAAoB,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,GAAG,gBAAgB,KAAK,IAAI,CAAC;IAEvE;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,GAAG,gBAAgB,KAAK,IAAI,CAAC;IAExE;;OAEG;IACH,iCAAiC,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,GAAG,gBAAgB,KAAK,IAAI,CAAC;IAEpF;;;OAGG;IACH,WAAW,CAAC,EAAE,GAAG,CAAC;IAElB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,GAAG,CAAC,OAAO,CAg7BhG"}
|
|
@@ -16,18 +16,17 @@ import Popper from '@mui/material/Popper';
|
|
|
16
16
|
import Icon from '@mui/material/Icon';
|
|
17
17
|
import CentralProgress from '../CentralProgress';
|
|
18
18
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
19
|
-
import { copyTextToClipboard } from '@selfcommunity/utils';
|
|
19
|
+
import { copyTextToClipboard, Logger } from '@selfcommunity/utils';
|
|
20
20
|
import { useSnackbar } from 'notistack';
|
|
21
|
-
import {
|
|
21
|
+
import { getContributionRouteName, getRouteData } from '../../utils/contribution';
|
|
22
22
|
import classNames from 'classnames';
|
|
23
23
|
import ConfirmDialog from '../ConfirmDialog/ConfirmDialog';
|
|
24
24
|
import { Badge, Box, CircularProgress, ClickAwayListener, Collapse, Divider, Grow, IconButton, ListItemIcon, ListItemText, MenuItem, MenuList, Paper, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { Logger } from '@selfcommunity/utils';
|
|
25
|
+
import { MODERATION_CONTRIBUTION_STATE_DELETED, MODERATION_CONTRIBUTION_STATE_HIDDEN, MODERATION_TYPE_ACTION_DELETE, MODERATION_TYPE_ACTION_HIDE, REPORT_AGGRESSIVE, REPORT_OFFTOPIC, REPORT_POORCONTENT, REPORT_SPAM, REPORT_VULGAR, REPORTS } from '../../constants/Flagging';
|
|
26
|
+
import { Endpoints, http } from '@selfcommunity/api-services';
|
|
28
27
|
import { SCContext, SCUserContext, UserUtils, useSCFetchCommentObject, useSCFetchFeedObject, useSCRouting } from '@selfcommunity/react-core';
|
|
29
|
-
import { SCCommentTypologyType,
|
|
30
|
-
import {
|
|
28
|
+
import { SCCommentTypologyType, SCContributionType } from '@selfcommunity/types';
|
|
29
|
+
import { DELETE_CONTRIBUTION, DELETE_CONTRIBUTION_SECTION, EDIT_CONTRIBUTION, FLAG_CONTRIBUTION_SECTION, GENERAL_SECTION, GET_CONTRIBUTION_PERMALINK, HIDE_CONTRIBUTION_SECTION, MODERATE_CONTRIBUTION_DELETED, MODERATE_CONTRIBUTION_HIDDEN, RESTORE_CONTRIBUTION, SUSPEND_NOTIFICATION_CONTRIBUTION } from '../../constants/ContributionsActionsMenu';
|
|
31
30
|
import BaseDrawer from '../BaseDrawer';
|
|
32
31
|
const PREFIX = 'SCContributionActionsMenu';
|
|
33
32
|
const classes = {
|
|
@@ -131,7 +130,7 @@ const messages = defineMessages({
|
|
|
131
130
|
});
|
|
132
131
|
export default function ContributionActionsMenu(props) {
|
|
133
132
|
// PROPS
|
|
134
|
-
const { className, feedObjectId, feedObject, feedObjectType =
|
|
133
|
+
const { className, feedObjectId, feedObject, feedObjectType = SCContributionType.POST, commentObjectId, commentObject, onEditContribution, onHideContribution, onDeleteContribution, onRestoreContribution, onSuspendNotificationContribution, PopperProps = {} } = props, rest = __rest(props, ["className", "feedObjectId", "feedObject", "feedObjectType", "commentObjectId", "commentObject", "onEditContribution", "onHideContribution", "onDeleteContribution", "onRestoreContribution", "onSuspendNotificationContribution", "PopperProps"]);
|
|
135
134
|
// INTL
|
|
136
135
|
const intl = useIntl();
|
|
137
136
|
// CONTEXT
|
|
@@ -245,7 +244,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
245
244
|
setCurrentActionLoading(SUSPEND_NOTIFICATION_CONTRIBUTION);
|
|
246
245
|
performSuspendNotification()
|
|
247
246
|
.then((data) => {
|
|
248
|
-
const _feedObj = Object.assign(feedObj, { suspended: !feedObj.suspended });
|
|
247
|
+
const _feedObj = Object.assign({}, feedObj, { suspended: !feedObj.suspended });
|
|
249
248
|
setFeedObj(_feedObj);
|
|
250
249
|
onSuspendNotificationContribution && onSuspendNotificationContribution(_feedObj);
|
|
251
250
|
setCurrentActionLoading(null);
|
|
@@ -541,7 +540,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
541
540
|
setCurrentActionLoading(RESTORE_CONTRIBUTION);
|
|
542
541
|
performDeleteContribution()
|
|
543
542
|
.then((data) => {
|
|
544
|
-
setFeedObj(Object.assign(feedObj, { deleted: true }));
|
|
543
|
+
setFeedObj(Object.assign({}, feedObj, { deleted: true }));
|
|
545
544
|
onDeleteContribution && onDeleteContribution(contributionObj);
|
|
546
545
|
performPostConfirmAction(true);
|
|
547
546
|
})
|
|
@@ -554,7 +553,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
554
553
|
setCurrentActionLoading(RESTORE_CONTRIBUTION);
|
|
555
554
|
performRestoreContribution()
|
|
556
555
|
.then((data) => {
|
|
557
|
-
setFeedObj(Object.assign(feedObj, { deleted: false }));
|
|
556
|
+
setFeedObj(Object.assign({}, feedObj, { deleted: false }));
|
|
558
557
|
onRestoreContribution && onRestoreContribution(contributionObj);
|
|
559
558
|
performPostConfirmAction(true);
|
|
560
559
|
})
|
|
@@ -569,7 +568,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
569
568
|
.then((data) => {
|
|
570
569
|
setHideType(hideType === hideFlagType ? null : hideFlagType);
|
|
571
570
|
setHideFlagType(null);
|
|
572
|
-
setFeedObj(Object.assign(feedObj, { collapsed: !feedObj.collapsed }));
|
|
571
|
+
setFeedObj(Object.assign({}, feedObj, { collapsed: !feedObj.collapsed }));
|
|
573
572
|
onHideContribution && onHideContribution(contributionObj);
|
|
574
573
|
performPostConfirmAction(true);
|
|
575
574
|
})
|
|
@@ -584,7 +583,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
584
583
|
.then((data) => {
|
|
585
584
|
setDeleteType(deleteType === deleteFlagType ? null : deleteFlagType);
|
|
586
585
|
setDeleteFlagType(null);
|
|
587
|
-
setFeedObj(Object.assign(feedObj, { deleted: !feedObj.deleted }));
|
|
586
|
+
setFeedObj(Object.assign({}, feedObj, { deleted: !feedObj.deleted }));
|
|
588
587
|
onDeleteContribution && onDeleteContribution(contributionObj);
|
|
589
588
|
performPostConfirmAction(true);
|
|
590
589
|
})
|