diff --git a/ui/component/claimMenuList/index.js b/ui/component/claimMenuList/index.js index 3079b61cd..acf6b99d4 100644 --- a/ui/component/claimMenuList/index.js +++ b/ui/component/claimMenuList/index.js @@ -28,6 +28,7 @@ import { doToast } from 'redux/actions/notifications'; import { makeSelectSigningIsMine } from 'redux/selectors/content'; import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions'; import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions'; +import { selectUserVerifiedEmail } from 'redux/selectors/user'; import ClaimPreview from './view'; import fs from 'fs'; @@ -49,6 +50,7 @@ const select = (state, props) => { collectionName: makeSelectNameForCollectionId(props.collectionId)(state), isMyCollection: makeSelectCollectionIsMine(props.collectionId)(state), editedCollection: makeSelectEditedCollectionForId(props.collectionId)(state), + isAuthenticated: Boolean(selectUserVerifiedEmail(state)), }; }; diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx index 712a81c26..8c1bfebe0 100644 --- a/ui/component/claimMenuList/view.jsx +++ b/ui/component/claimMenuList/view.jsx @@ -54,6 +54,7 @@ type Props = { doChannelUnsubscribe: (SubscriptionArgs) => void, isChannelPage: boolean, editedCollection: Collection, + isAuthenticated: boolean, }; function ClaimMenuList(props: Props) { @@ -89,6 +90,7 @@ function ClaimMenuList(props: Props) { doChannelUnsubscribe, isChannelPage = false, editedCollection, + isAuthenticated, } = props; const repostedContent = claim && claim.reposted_claim; const contentClaim = repostedContent || claim; @@ -223,176 +225,179 @@ function ClaimMenuList(props: Props) { {/* WATCH LATER */} - <> - {isPlayable && !collectionId && ( - { - doToast({ - message: __('Item %action% Watch Later', { - action: hasClaimInWatchLater - ? __('removed from --[substring for "Item %action% Watch Later"]--') - : __('added to --[substring for "Item %action% Watch Later"]--'), - }), - }); - doCollectionEdit(COLLECTIONS_CONSTS.WATCH_LATER_ID, { - claims: [contentClaim], - remove: hasClaimInWatchLater, - type: 'playlist', - }); - }} - > -
- - {hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')} -
-
- )} - {/* CUSTOM LIST */} - {isPlayable && !collectionId && ( - { - doToast({ - message: __(`Item %action% ${lastCollectionName}`, { - action: hasClaimInCustom ? __('removed from') : __('added to'), - }), - }); - doCollectionEdit(COLLECTIONS_CONSTS.FAVORITES_ID, { - claims: [contentClaim], - remove: hasClaimInCustom, - type: 'playlist', - }); - }} - > -
- - {hasClaimInCustom ? __(`In ${lastCollectionName}`) : __(`${lastCollectionName}`)} -
-
- )} - {/* COLLECTION OPERATIONS */} - {collectionId && collectionName && isCollectionClaim && ( + {(!IS_WEB || (IS_WEB && isAuthenticated)) && ( + <> <> - {Boolean(editedCollection) && ( + {isPlayable && !collectionId && ( push(`/$/${PAGES.LIST}/${collectionId}?view=edit`)} + onSelect={() => { + doToast({ + message: __('Item %action% Watch Later', { + action: hasClaimInWatchLater + ? __('removed from --[substring for "Item %action% Watch Later"]--') + : __('added to --[substring for "Item %action% Watch Later"]--'), + }), + }); + doCollectionEdit(COLLECTIONS_CONSTS.WATCH_LATER_ID, { + claims: [contentClaim], + remove: hasClaimInWatchLater, + type: 'playlist', + }); + }} >
- - {__('Publish')} + + {hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')}
)} - push(`/$/${PAGES.LIST}/${collectionId}`)}> -
- - {__('View List')} -
-
- openModal(MODALS.COLLECTION_DELETE, { collectionId })} - > -
- - {__('Delete List')} -
-
- - )} - {/* CURRENTLY ONLY SUPPORT PLAYLISTS FOR PLAYABLE; LATER DIFFERENT TYPES */} - {isPlayable && ( - openModal(MODALS.COLLECTION_ADD, { uri, type: 'playlist' })} - > -
- - {__('Add to Lists')} -
-
- )} - - {!isChannelPage && ( - <> -
- -
- - {__('Support --[button to support a claim]--')} -
-
- - )} - - {!incognitoClaim && !isRepost && !claimIsMine && !isChannelPage && ( - <> -
- -
- - {subscriptionLabel} -
-
- - )} - {!isMyCollection && ( - <> - {(!claimIsMine || channelIsBlocked) && channelUri ? ( - !incognitoClaim && - !isRepost && ( + {/* CUSTOM LIST */} + {isPlayable && !collectionId && ( + { + doToast({ + message: __(`Item %action% ${lastCollectionName}`, { + action: hasClaimInCustom ? __('removed from') : __('added to'), + }), + }); + doCollectionEdit(COLLECTIONS_CONSTS.FAVORITES_ID, { + claims: [contentClaim], + remove: hasClaimInCustom, + type: 'playlist', + }); + }} + > +
+ + {hasClaimInCustom ? __(`In ${lastCollectionName}`) : __(`${lastCollectionName}`)} +
+
+ )} + {/* COLLECTION OPERATIONS */} + {collectionId && collectionName && isCollectionClaim && ( <> -
- -
- - {channelIsBlocked ? __('Unblock Channel') : __('Block Channel')} -
-
- - {isAdmin && ( - + {Boolean(editedCollection) && ( + push(`/$/${PAGES.LIST}/${collectionId}?view=edit`)} + >
- - {channelIsAdminBlocked ? __('Global Unblock Channel') : __('Global Block Channel')} + + {__('Publish')}
)} - - + push(`/$/${PAGES.LIST}/${collectionId}`)}>
- - {channelIsMuted ? __('Unmute Channel') : __('Mute Channel')} + + {__('View List')} +
+
+ openModal(MODALS.COLLECTION_DELETE, { collectionId })} + > +
+ + {__('Delete List')}
- ) - ) : ( + )} + {/* CURRENTLY ONLY SUPPORT PLAYLISTS FOR PLAYABLE; LATER DIFFERENT TYPES */} + {isPlayable && ( + openModal(MODALS.COLLECTION_ADD, { uri, type: 'playlist' })} + > +
+ + {__('Add to Lists')} +
+
+ )} + + {!isChannelPage && ( <> - {!isChannelPage && !isRepost && ( - -
- - {__('Edit')} -
-
- )} +
+ +
+ + {__('Support --[button to support a claim]--')} +
+
+ + )} - {showDelete && ( - -
- - {__('Delete')} -
-
+ {!incognitoClaim && !isRepost && !claimIsMine && !isChannelPage && ( + <> +
+ +
+ + {subscriptionLabel} +
+
+ + )} + {!isMyCollection && ( + <> + {(!claimIsMine || channelIsBlocked) && channelUri ? ( + !incognitoClaim && + !isRepost && ( + <> +
+ +
+ + {channelIsBlocked ? __('Unblock Channel') : __('Block Channel')} +
+
+ + {isAdmin && ( + +
+ + {channelIsAdminBlocked ? __('Global Unblock Channel') : __('Global Block Channel')} +
+
+ )} + + +
+ + {channelIsMuted ? __('Unmute Channel') : __('Mute Channel')} +
+
+ + ) + ) : ( + <> + {!isChannelPage && !isRepost && ( + +
+ + {__('Edit')} +
+
+ )} + + {showDelete && ( + +
+ + {__('Delete')} +
+
+ )} + )} )} )} -
{isChannelPage && IS_WEB && rssUrl && (