remove redundancy when buttons are already on page
This commit is contained in:
parent
3a6bddc588
commit
4ef8247985
2 changed files with 22 additions and 14 deletions
|
@ -48,6 +48,7 @@ type Props = {
|
||||||
isSubscribed: boolean,
|
isSubscribed: boolean,
|
||||||
doChannelSubscribe: (SubscriptionArgs) => void,
|
doChannelSubscribe: (SubscriptionArgs) => void,
|
||||||
doChannelUnsubscribe: (SubscriptionArgs) => void,
|
doChannelUnsubscribe: (SubscriptionArgs) => void,
|
||||||
|
isChannelPage: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
function ClaimMenuList(props: Props) {
|
function ClaimMenuList(props: Props) {
|
||||||
|
@ -76,6 +77,7 @@ function ClaimMenuList(props: Props) {
|
||||||
isSubscribed,
|
isSubscribed,
|
||||||
doChannelSubscribe,
|
doChannelSubscribe,
|
||||||
doChannelUnsubscribe,
|
doChannelUnsubscribe,
|
||||||
|
isChannelPage = false,
|
||||||
} = props;
|
} = props;
|
||||||
const incognito = channelUri && !(channelUri.includes('@'));
|
const incognito = channelUri && !(channelUri.includes('@'));
|
||||||
const signingChannel = claim && (claim.signing_channel || claim);
|
const signingChannel = claim && (claim.signing_channel || claim);
|
||||||
|
@ -186,7 +188,7 @@ function ClaimMenuList(props: Props) {
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
<MenuList className="menu__list">
|
<MenuList className="menu__list">
|
||||||
|
|
||||||
{!incognito && (!claimIsMine ? (
|
{!incognito && (!claimIsMine ? (!isChannelPage &&
|
||||||
<MenuItem className="comment__menu-option" onSelect={handleFollow}>
|
<MenuItem className="comment__menu-option" onSelect={handleFollow}>
|
||||||
<div className="menu__link">
|
<div className="menu__link">
|
||||||
<Icon aria-hidden icon={ICONS.SUBSCRIBE} />
|
<Icon aria-hidden icon={ICONS.SUBSCRIBE} />
|
||||||
|
@ -201,12 +203,15 @@ function ClaimMenuList(props: Props) {
|
||||||
</div>
|
</div>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
))}
|
))}
|
||||||
<MenuItem className="comment__menu-option" onSelect={handleSupport}>
|
|
||||||
<div className="menu__link">
|
{!isChannelPage && (
|
||||||
<Icon aria-hidden icon={ICONS.LBC} />
|
<MenuItem className="comment__menu-option" onSelect={handleSupport}>
|
||||||
{__('Support')}
|
<div className="menu__link">
|
||||||
</div>
|
<Icon aria-hidden icon={ICONS.LBC} />
|
||||||
</MenuItem>
|
{__('Support')}
|
||||||
|
</div>
|
||||||
|
</MenuItem>
|
||||||
|
)}
|
||||||
|
|
||||||
{hasExperimentalUi && (
|
{hasExperimentalUi && (
|
||||||
<>
|
<>
|
||||||
|
@ -289,12 +294,14 @@ function ClaimMenuList(props: Props) {
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<MenuItem className="comment__menu-option" onSelect={handleEdit}>
|
{!isChannelPage && (
|
||||||
<div className="menu__link">
|
<MenuItem className="comment__menu-option" onSelect={handleEdit}>
|
||||||
<Icon aria-hidden icon={ICONS.EDIT} />
|
<div className="menu__link">
|
||||||
{__('Edit')}
|
<Icon aria-hidden icon={ICONS.EDIT} />
|
||||||
</div>
|
{__('Edit')}
|
||||||
</MenuItem>
|
</div>
|
||||||
|
</MenuItem>
|
||||||
|
)}
|
||||||
|
|
||||||
{showDelete && (
|
{showDelete && (
|
||||||
<MenuItem className="comment__menu-option" onSelect={handleDelete}>
|
<MenuItem className="comment__menu-option" onSelect={handleDelete}>
|
||||||
|
|
|
@ -191,7 +191,8 @@ function ChannelPage(props: Props) {
|
||||||
{!channelIsBlackListed && <ShareButton uri={uri} />}
|
{!channelIsBlackListed && <ShareButton uri={uri} />}
|
||||||
{!(isBlocked || isMuted) && <ClaimSupportButton uri={uri} />}
|
{!(isBlocked || isMuted) && <ClaimSupportButton uri={uri} />}
|
||||||
{!(isBlocked || isMuted) && (!channelIsBlackListed || isSubscribed) && <SubscribeButton uri={permanentUrl} />}
|
{!(isBlocked || isMuted) && (!channelIsBlackListed || isSubscribed) && <SubscribeButton uri={permanentUrl} />}
|
||||||
<ClaimMenuList uri={claim.permanent_url} channelUri={claim.permanent_url} inline />
|
{/* TODO: add channel collections <ClaimCollectionAddButton uri={uri} fileAction /> */}
|
||||||
|
<ClaimMenuList uri={claim.permanent_url} channelUri={claim.permanent_url} inline isChannelPage />
|
||||||
</div>
|
</div>
|
||||||
{cover && <img className={classnames('channel-cover__custom')} src={cover} />}
|
{cover && <img className={classnames('channel-cover__custom')} src={cover} />}
|
||||||
<div className="channel__primary-info">
|
<div className="channel__primary-info">
|
||||||
|
|
Loading…
Add table
Reference in a new issue