lists for all

This commit is contained in:
zeppi 2021-06-15 18:14:56 -04:00 committed by jessopb
parent 179f16470b
commit ff5c28a70f
6 changed files with 26 additions and 44 deletions

View file

@ -16,8 +16,6 @@ import { doSetActiveChannel, doSetIncognito, doOpenModal } from 'redux/actions/a
import { doCommentModBlock, doCommentModUnBlock } from 'redux/actions/comments'; import { doCommentModBlock, doCommentModUnBlock } from 'redux/actions/comments';
import { makeSelectChannelIsBlocked } from 'redux/selectors/comments'; import { makeSelectChannelIsBlocked } from 'redux/selectors/comments';
import { doToast } from 'redux/actions/notifications'; import { doToast } from 'redux/actions/notifications';
import { makeSelectUserPropForProp } from 'redux/selectors/user';
import * as USER from 'constants/user';
import { makeSelectSigningIsMine } from 'redux/selectors/content'; import { makeSelectSigningIsMine } from 'redux/selectors/content';
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions'; import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions'; import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
@ -38,7 +36,6 @@ const select = (state, props) => {
claimInCollection: makeSelectCollectionForIdHasClaimUrl(props.collectionId, permanentUri)(state), claimInCollection: makeSelectCollectionForIdHasClaimUrl(props.collectionId, permanentUri)(state),
collectionName: makeSelectNameForCollectionId(props.collectionId)(state), collectionName: makeSelectNameForCollectionId(props.collectionId)(state),
isMyCollection: makeSelectCollectionIsMine(props.collectionId)(state), isMyCollection: makeSelectCollectionIsMine(props.collectionId)(state),
hasExperimentalUi: makeSelectUserPropForProp(USER.EXPERIMENTAL_UI)(state),
editedCollection: makeSelectEditedCollectionForId(props.collectionId)(state), editedCollection: makeSelectEditedCollectionForId(props.collectionId)(state),
}; };
}; };

View file

@ -41,7 +41,6 @@ type Props = {
collectionId: string, collectionId: string,
isMyCollection: boolean, isMyCollection: boolean,
doToast: ({ message: string }) => void, doToast: ({ message: string }) => void,
hasExperimentalUi: boolean,
claimIsMine: boolean, claimIsMine: boolean,
fileInfo: FileListItem, fileInfo: FileListItem,
prepareEdit: ({}, string, {}) => void, prepareEdit: ({}, string, {}) => void,
@ -72,7 +71,6 @@ function ClaimMenuList(props: Props) {
collectionName, collectionName,
isMyCollection, isMyCollection,
doToast, doToast,
hasExperimentalUi,
claimIsMine, claimIsMine,
fileInfo, fileInfo,
prepareEdit, prepareEdit,
@ -189,33 +187,29 @@ function ClaimMenuList(props: Props) {
<Icon size={20} icon={ICONS.MORE_VERTICAL} /> <Icon size={20} icon={ICONS.MORE_VERTICAL} />
</MenuButton> </MenuButton>
<MenuList className="menu__list"> <MenuList className="menu__list">
{hasExperimentalUi && ( {/* WATCH LATER */}
{isPlayable && !collectionId && (
<> <>
{/* WATCH LATER */} <MenuItem
{isPlayable && !collectionId && ( className="comment__menu-option"
<> onSelect={() => {
<MenuItem doToast({
className="comment__menu-option" message: __('Item %action% Watch Later', {
onSelect={() => { action: hasClaimInWatchLater ? __('removed from') : __('added to'),
doToast({ }),
message: __('Item %action% Watch Later', { });
action: hasClaimInWatchLater ? __('removed from') : __('added to'), doCollectionEdit(COLLECTIONS_CONSTS.WATCH_LATER_ID, {
}), claims: [contentClaim],
}); remove: hasClaimInWatchLater,
doCollectionEdit(COLLECTIONS_CONSTS.WATCH_LATER_ID, { type: 'playlist',
claims: [contentClaim], });
remove: hasClaimInWatchLater, }}
type: 'playlist', >
}); <div className="menu__link">
}} <Icon aria-hidden icon={hasClaimInWatchLater ? ICONS.DELETE : ICONS.TIME} />
> {hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')}
<div className="menu__link"> </div>
<Icon aria-hidden icon={hasClaimInWatchLater ? ICONS.DELETE : ICONS.TIME} /> </MenuItem>
{hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')}
</div>
</MenuItem>
</>
)}
{/* COLLECTION OPERATIONS */} {/* COLLECTION OPERATIONS */}
{collectionId && collectionName && isCollectionClaim && ( {collectionId && collectionName && isCollectionClaim && (
<> <>

View file

@ -9,14 +9,12 @@ import {
makeSelectTagInClaimOrChannelForUri, makeSelectTagInClaimOrChannelForUri,
} from 'lbry-redux'; } from 'lbry-redux';
import { DISABLE_COMMENTS_TAG } from 'constants/tags'; import { DISABLE_COMMENTS_TAG } from 'constants/tags';
import { makeSelectUserPropForProp } from 'redux/selectors/user';
import { makeSelectCostInfoForUri } from 'lbryinc'; import { makeSelectCostInfoForUri } from 'lbryinc';
import { doSetPlayingUri } from 'redux/actions/content'; import { doSetPlayingUri } from 'redux/actions/content';
import { doToast } from 'redux/actions/notifications'; import { doToast } from 'redux/actions/notifications';
import { doOpenModal, doSetActiveChannel, doSetIncognito } from 'redux/actions/app'; import { doOpenModal, doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
import fs from 'fs'; import fs from 'fs';
import FileActions from './view'; import FileActions from './view';
import * as USER from 'constants/user';
import { makeSelectFileRenderModeForUri } from 'redux/selectors/content'; import { makeSelectFileRenderModeForUri } from 'redux/selectors/content';
const select = (state, props) => ({ const select = (state, props) => ({
@ -28,7 +26,6 @@ const select = (state, props) => ({
myChannels: selectMyChannelClaims(state), myChannels: selectMyChannelClaims(state),
isLivestreamClaim: makeSelectClaimIsStreamPlaceholder(props.uri)(state), isLivestreamClaim: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
reactionsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state), reactionsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
hasExperimentalUi: makeSelectUserPropForProp(USER.EXPERIMENTAL_UI)(state),
}); });
const perform = (dispatch) => ({ const perform = (dispatch) => ({

View file

@ -28,7 +28,6 @@ type Props = {
clearPlayingUri: () => void, clearPlayingUri: () => void,
isLivestreamClaim: boolean, isLivestreamClaim: boolean,
reactionsDisabled: boolean, reactionsDisabled: boolean,
hasExperimentalUi: boolean,
}; };
function FileActions(props: Props) { function FileActions(props: Props) {
@ -46,7 +45,6 @@ function FileActions(props: Props) {
doToast, doToast,
isLivestreamClaim, isLivestreamClaim,
reactionsDisabled, reactionsDisabled,
hasExperimentalUi,
} = props; } = props;
const { const {
push, push,
@ -92,7 +90,7 @@ function FileActions(props: Props) {
<> <>
{ENABLE_FILE_REACTIONS && !reactionsDisabled && <FileReactions uri={uri} />} {ENABLE_FILE_REACTIONS && !reactionsDisabled && <FileReactions uri={uri} />}
<ClaimSupportButton uri={uri} fileAction /> <ClaimSupportButton uri={uri} fileAction />
{hasExperimentalUi && <ClaimCollectionAddButton uri={uri} fileAction />} <ClaimCollectionAddButton uri={uri} fileAction />
<Button <Button
button="alt" button="alt"
className="button--file-action" className="button--file-action"

View file

@ -2,11 +2,10 @@ import { connect } from 'react-redux';
import { selectSubscriptions } from 'redux/selectors/subscriptions'; import { selectSubscriptions } from 'redux/selectors/subscriptions';
import { selectPurchaseUriSuccess, doClearPurchasedUriSuccess } from 'lbry-redux'; import { selectPurchaseUriSuccess, doClearPurchasedUriSuccess } from 'lbry-redux';
import { selectFollowedTags } from 'redux/selectors/tags'; import { selectFollowedTags } from 'redux/selectors/tags';
import { selectUserVerifiedEmail, selectUser, makeSelectUserPropForProp } from 'redux/selectors/user'; import { selectUserVerifiedEmail, selectUser } from 'redux/selectors/user';
import { selectHomepageData, selectLanguage } from 'redux/selectors/settings'; import { selectHomepageData, selectLanguage } from 'redux/selectors/settings';
import { doSignOut } from 'redux/actions/app'; import { doSignOut } from 'redux/actions/app';
import { selectUnseenNotificationCount } from 'redux/selectors/notifications'; import { selectUnseenNotificationCount } from 'redux/selectors/notifications';
import * as USER from 'constants/user';
import SideNavigation from './view'; import SideNavigation from './view';
@ -19,7 +18,6 @@ const select = (state) => ({
unseenCount: selectUnseenNotificationCount(state), unseenCount: selectUnseenNotificationCount(state),
user: selectUser(state), user: selectUser(state),
homepageData: selectHomepageData(state), homepageData: selectHomepageData(state),
hasExperimentalUi: makeSelectUserPropForProp(USER.EXPERIMENTAL_UI)(state),
}); });
export default connect(select, { export default connect(select, {

View file

@ -46,7 +46,6 @@ type Props = {
doClearPurchasedUriSuccess: () => void, doClearPurchasedUriSuccess: () => void,
user: ?User, user: ?User,
homepageData: any, homepageData: any,
hasExperimentalUi: boolean,
}; };
type SideNavLink = { type SideNavLink = {
@ -74,7 +73,6 @@ function SideNavigation(props: Props) {
homepageData, homepageData,
user, user,
followedTags, followedTags,
hasExperimentalUi,
} = props; } = props;
const { EXTRA_SIDEBAR_LINKS } = homepageData; const { EXTRA_SIDEBAR_LINKS } = homepageData;
@ -221,7 +219,7 @@ function SideNavigation(props: Props) {
SIDE_LINKS.push(HOME); SIDE_LINKS.push(HOME);
SIDE_LINKS.push(RECENT_FROM_FOLLOWING); SIDE_LINKS.push(RECENT_FROM_FOLLOWING);
if (!SIMPLE_SITE && hasExperimentalUi) { if (!SIMPLE_SITE) {
FULL_LINKS.push({ FULL_LINKS.push({
title: 'Lists', title: 'Lists',
link: `/$/${PAGES.LISTS}`, link: `/$/${PAGES.LISTS}`,
@ -231,7 +229,7 @@ function SideNavigation(props: Props) {
} }
if (!SIMPLE_SITE) { if (!SIMPLE_SITE) {
SIDE_LINKS.push(...FULL_LINKS); SIDE_LINKS.push(...FULL_LINKS);
} else if (SIMPLE_SITE && hasExperimentalUi) { } else if (SIMPLE_SITE) {
SIDE_LINKS.push({ SIDE_LINKS.push({
title: 'Lists', title: 'Lists',
link: `/$/${PAGES.LISTS}`, link: `/$/${PAGES.LISTS}`,