hide embed area for channel share modal

This commit is contained in:
Sean Yesmunt 2019-11-14 12:11:46 -05:00
parent 66c6ec1626
commit 97cb4ff3bc
3 changed files with 6 additions and 5 deletions

View file

@ -6,18 +6,19 @@ import Button from 'component/button';
type Props = {
uri: string,
isChannel: boolean,
doOpenModal: (id: string, {}) => void,
};
export default function ShareButton(props: Props) {
const { uri, doOpenModal } = props;
const { uri, doOpenModal, isChannel = false } = props;
return (
<Button
button="alt"
icon={ICONS.SHARE}
label={__('Share')}
onClick={() => doOpenModal(MODALS.SOCIAL_SHARE, { uri, webShareable: true, isChannel: true })}
onClick={() => doOpenModal(MODALS.SOCIAL_SHARE, { uri, webShareable: true, isChannel })}
/>
);
}

View file

@ -26,7 +26,7 @@ class SocialShare extends React.PureComponent<Props> {
input: ?HTMLInputElement;
render() {
const { claim } = this.props;
const { claim, isChannel } = this.props;
const { canonical_url: canonicalUrl, permanent_url: permanentUrl } = claim;
const { webShareable, onDone } = this.props;
const OPEN_URL = 'https://open.lbry.com/';
@ -55,7 +55,7 @@ class SocialShare extends React.PureComponent<Props> {
href={`https://twitter.com/intent/tweet?text=${encodedLbryURL}`}
/>
</div>
{webShareable && <EmbedArea label={__('Embedded')} claim={claim} noSnackbar />}
{webShareable && !isChannel && <EmbedArea label={__('Embedded')} claim={claim} noSnackbar />}
{!webShareable && <p className={'help'}>{__('Paid content cannot be embedded')}</p>}
<div className="card__actions">
<Button button="link" label={__('Done')} onClick={onDone} />

View file

@ -166,7 +166,7 @@ function ChannelPage(props: Props) {
<div className="card">
<header className="channel-cover">
<div className="channel__quick-actions">
{!channelIsBlocked && !channelIsBlackListed && <ShareButton uri={uri} />}
{!channelIsBlocked && !channelIsBlackListed && <ShareButton uri={uri} isChannel />}
{!channelIsMine && (
<Button
button="alt"