From 2aaa9f358bc5d7c13f07486e7e507af090289e48 Mon Sep 17 00:00:00 2001 From: saltrafael Date: Fri, 11 Jun 2021 17:49:18 -0300 Subject: [PATCH] Additional pop up menu options --- ui/component/channelBlockButton/view.jsx | 12 +- ui/component/channelMuteButton/index.js | 5 +- ui/component/channelMuteButton/view.jsx | 15 ++- ui/component/claimList/view.jsx | 3 - ui/component/claimListDiscover/view.jsx | 3 - ui/component/claimMenuList/index.js | 52 +++++--- ui/component/claimMenuList/view.jsx | 154 ++++++++++++++++++++--- ui/component/claimPreview/view.jsx | 3 +- ui/component/claimPreviewTile/view.jsx | 9 +- ui/component/commentMenuList/index.js | 4 +- ui/component/commentMenuList/view.jsx | 6 +- ui/page/channel/view.jsx | 3 +- ui/redux/actions/blocked.js | 47 +++++-- ui/redux/actions/comments.js | 30 ++--- ui/redux/actions/subscriptions.js | 119 ++++++++++-------- ui/redux/selectors/content.js | 21 ++++ 16 files changed, 336 insertions(+), 150 deletions(-) diff --git a/ui/component/channelBlockButton/view.jsx b/ui/component/channelBlockButton/view.jsx index a2dfa7a36..742205258 100644 --- a/ui/component/channelBlockButton/view.jsx +++ b/ui/component/channelBlockButton/view.jsx @@ -6,8 +6,8 @@ type Props = { uri: string, isBlocked: boolean, isBlockingOrUnBlocking: boolean, - doCommentModUnBlock: (string) => void, - doCommentModBlock: (string) => void, + doCommentModUnBlock: (string, boolean) => void, + doCommentModBlock: (string, boolean) => void, }; function ChannelBlockButton(props: Props) { @@ -15,9 +15,9 @@ function ChannelBlockButton(props: Props) { function handleClick() { if (isBlocked) { - doCommentModUnBlock(uri); + doCommentModUnBlock(uri, false); } else { - doCommentModBlock(uri); + doCommentModBlock(uri, false); } } @@ -30,8 +30,8 @@ function ChannelBlockButton(props: Props) { ? __('Unblocking...') : __('Unblock') : isBlockingOrUnBlocking - ? __('Blocking...') - : __('Block') + ? __('Blocking...') + : __('Block') } onClick={handleClick} /> diff --git a/ui/component/channelMuteButton/index.js b/ui/component/channelMuteButton/index.js index 4a9df8dee..781ae1880 100644 --- a/ui/component/channelMuteButton/index.js +++ b/ui/component/channelMuteButton/index.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import { doToggleMuteChannel } from 'redux/actions/blocked'; +import { doChannelMute, doChannelUnmute } from 'redux/actions/blocked'; import { makeSelectChannelIsMuted } from 'redux/selectors/blocked'; import ChannelMuteButton from './view'; @@ -8,5 +8,6 @@ const select = (state, props) => ({ }); export default connect(select, { - doToggleMuteChannel, + doChannelMute, + doChannelUnmute, })(ChannelMuteButton); diff --git a/ui/component/channelMuteButton/view.jsx b/ui/component/channelMuteButton/view.jsx index 53d4a4b0e..2ffa6866b 100644 --- a/ui/component/channelMuteButton/view.jsx +++ b/ui/component/channelMuteButton/view.jsx @@ -6,17 +6,26 @@ type Props = { uri: string, isMuted: boolean, channelClaim: ?ChannelClaim, - doToggleMuteChannel: (string) => void, + doChannelMute: (string, boolean) => void, + doChannelUnmute: (string, boolean) => void, }; function ChannelBlockButton(props: Props) { - const { uri, doToggleMuteChannel, isMuted } = props; + const { uri, doChannelMute, doChannelUnmute, isMuted } = props; + + function handleClick() { + if (isMuted) { + doChannelUnmute(uri, false); + } else { + doChannelMute(uri, false); + } + } return (