mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
edit option delete option analytics for channel claim support option follow option fix revert subscription actions block actions mute actions block and mute buttons mute menu option lint handle edit channel fix comment mute logic analytics handle delete channel fix claimismine fix rebase
33 lines
696 B
JavaScript
33 lines
696 B
JavaScript
// @flow
|
|
import React from 'react';
|
|
import Button from 'component/button';
|
|
|
|
type Props = {
|
|
uri: string,
|
|
isMuted: boolean,
|
|
channelClaim: ?ChannelClaim,
|
|
doChannelMute: (string, boolean) => void,
|
|
doChannelUnmute: (string, boolean) => void,
|
|
};
|
|
|
|
function ChannelBlockButton(props: Props) {
|
|
const { uri, doChannelMute, doChannelUnmute, isMuted } = props;
|
|
|
|
function handleClick() {
|
|
if (isMuted) {
|
|
doChannelUnmute(uri, false);
|
|
} else {
|
|
doChannelMute(uri, false);
|
|
}
|
|
}
|
|
|
|
return (
|
|
<Button
|
|
button={isMuted ? 'alt' : 'secondary'}
|
|
label={isMuted ? __('Unmute') : __('Mute')}
|
|
onClick={handleClick}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default ChannelBlockButton;
|