lbry-desktop/ui/component/channelMuteButton/view.jsx
infinite-persistence d97a23b699 Rename default import/exports for clarity in text search (no functional change)
I believe it was just due to copy/pasting from another file and not renaming it.
2021-07-09 08:40:26 +08:00

30 lines
672 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 ChannelMuteButton(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 ChannelMuteButton;