Merge branch 'master' of github.com:lbryio/lbry-desktop

This commit is contained in:
zeppi 2021-06-18 19:08:19 -04:00
commit 98593a15f6
5 changed files with 19 additions and 9 deletions

View file

@ -1988,5 +1988,11 @@
"Chat": "Chat", "Chat": "Chat",
"Tipped": "Tipped", "Tipped": "Tipped",
"Fromage": "Fromage", "Fromage": "Fromage",
"added to": "added to",
"Item %action% Watch Later": "Item %action% Watch Later",
"In Watch Later": "In Watch Later",
"Item added to Watch Later": "Item added to Watch Later",
"Your publish is being confirmed and will be live soon": "Your publish is being confirmed and will be live soon",
"Clear Edits": "Clear Edits",
"--end--": "--end--" "--end--": "--end--"
} }

View file

@ -11,11 +11,11 @@ import {
selectUpdatingCollection, selectUpdatingCollection,
selectCreateCollectionError, selectCreateCollectionError,
selectBalance, selectBalance,
doClearCollectionErrors,
selectCreatingCollection, selectCreatingCollection,
makeSelectCollectionForId, makeSelectCollectionForId,
makeSelectUrlsForCollectionId, makeSelectUrlsForCollectionId,
makeSelectClaimIdsForCollectionId, makeSelectClaimIdsForCollectionId,
ACTIONS as LBRY_REDUX_ACTIONS,
} from 'lbry-redux'; } from 'lbry-redux';
import { doOpenModal } from 'redux/actions/app'; import { doOpenModal } from 'redux/actions/app';
@ -47,7 +47,7 @@ const perform = (dispatch) => ({
openModal: (modal, props) => dispatch(doOpenModal(modal, props)), openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
publishCollectionUpdate: (params) => dispatch(doCollectionPublishUpdate(params)), publishCollectionUpdate: (params) => dispatch(doCollectionPublishUpdate(params)),
publishCollection: (params, collectionId) => dispatch(doCollectionPublish(params, collectionId)), publishCollection: (params, collectionId) => dispatch(doCollectionPublish(params, collectionId)),
clearCollectionErrors: () => dispatch(doClearCollectionErrors()), clearCollectionErrors: () => dispatch({ type: LBRY_REDUX_ACTIONS.CLEAR_COLLECTION_ERRORS }),
}); });
export default connect(select, perform)(CollectionPage); export default connect(select, perform)(CollectionPage);

View file

@ -21,6 +21,7 @@ import { INVALID_NAME_ERROR } from 'constants/claim';
import SUPPORTED_LANGUAGES from 'constants/supported_languages'; import SUPPORTED_LANGUAGES from 'constants/supported_languages';
import * as PAGES from 'constants/pages'; import * as PAGES from 'constants/pages';
import analytics from 'analytics'; import analytics from 'analytics';
import * as ICONS from '../../constants/icons';
const LANG_NONE = 'none'; const LANG_NONE = 'none';
const MAX_TAG_SELECT = 5; const MAX_TAG_SELECT = 5;
@ -86,6 +87,7 @@ function CollectionForm(props: Props) {
collection, collection,
collectionUrls, collectionUrls,
collectionClaimIds, collectionClaimIds,
clearCollectionErrors,
} = props; } = props;
const activeChannelName = activeChannelClaim && activeChannelClaim.name; const activeChannelName = activeChannelClaim && activeChannelClaim.name;
let prefix = IS_WEB ? `${DOMAIN}/` : 'lbry://'; let prefix = IS_WEB ? `${DOMAIN}/` : 'lbry://';
@ -163,6 +165,7 @@ function CollectionForm(props: Props) {
React.useEffect(() => { React.useEffect(() => {
const collectionClaimIds = JSON.parse(collectionClaimIdsString); const collectionClaimIds = JSON.parse(collectionClaimIdsString);
setParams({ ...params, claims: collectionClaimIds }); setParams({ ...params, claims: collectionClaimIds });
clearCollectionErrors();
}, [collectionClaimIdsString, setParams]); }, [collectionClaimIdsString, setParams]);
function handleLanguageChange(index, code) { function handleLanguageChange(index, code) {
@ -228,12 +231,16 @@ function CollectionForm(props: Props) {
setParams({ ...params, channel_id: activeChannelId }); setParams({ ...params, channel_id: activeChannelId });
} }
}, [activeChannelId, incognito, setParams]); }, [activeChannelId, incognito, setParams]);
const itemError = !params.claims.length ? __('Cannot publish empty list') : ''; const itemError = !params.claims.length ? __('Cannot publish empty list') : '';
const submitError = nameError || bidError || itemError || updateError || createError; const submitError = nameError || bidError || itemError || updateError || createError;
return ( return (
<> <>
<div className={classnames('main--contained', { 'card--disabled': disabled })}> <div className={classnames('main--contained', { 'card--disabled': disabled })}>
<div>
<Button button="close" label={__('New')} icon={ICONS.REFRESH} onClick={() => alert()} />
</div>
<Tabs> <Tabs>
<TabList className="tabs__list--collection-edit-page"> <TabList className="tabs__list--collection-edit-page">
<Tab>{__('General')}</Tab> <Tab>{__('General')}</Tab>

View file

@ -66,7 +66,7 @@ export default function CollectionsListMine(props: Props) {
navigate={`/$/${PAGES.LIST}/${list.id}`} navigate={`/$/${PAGES.LIST}/${list.id}`}
label={ label={
<span className="claim-grid__title-span"> <span className="claim-grid__title-span">
{list.name} {__(`${list.name}`)}
<div className="claim-grid__title--empty"> <div className="claim-grid__title--empty">
<Icon className="icon--margin-right" icon={ICONS.STACK} /> <Icon className="icon--margin-right" icon={ICONS.STACK} />
{itemUrls.length} {itemUrls.length}
@ -80,7 +80,7 @@ export default function CollectionsListMine(props: Props) {
)} )}
{!(itemUrls && itemUrls.length) && ( {!(itemUrls && itemUrls.length) && (
<h1 className="claim-grid__header claim-grid__title"> <h1 className="claim-grid__header claim-grid__title">
{__('%collection_name%', { collection_name: list.name })}{' '} {__(`${list.name}`)}
<div className="claim-grid__title--empty">(Empty)</div> <div className="claim-grid__title--empty">(Empty)</div>
</h1> </h1>
)} )}

View file

@ -80,7 +80,7 @@ function SelectAsset(props: Props) {
} }
// Note for translators: e.g. "Thumbnail (1:1)" // Note for translators: e.g. "Thumbnail (1:1)"
const label = __('%image_type% %recommended_ratio%', { image_type: assetName, recommended_ratio: recommended }); const label = `${__(assetName)} ${__(recommended)}`;
const selectFileLabel = __('Select File'); const selectFileLabel = __('Select File');
const selectedLabel = pathSelected ? __('URL Selected') : __('File Selected'); const selectedLabel = pathSelected ? __('URL Selected') : __('File Selected');
@ -89,10 +89,7 @@ function SelectAsset(props: Props) {
fileSelectorLabel = __('Uploading...'); fileSelectorLabel = __('Uploading...');
} else { } else {
// Include the same label/recommendation for both 'URL' and 'UPLOAD'. // Include the same label/recommendation for both 'URL' and 'UPLOAD'.
fileSelectorLabel = __('%label% • %status%', { fileSelectorLabel = `${label} ${fileSelected || pathSelected ? __(selectedLabel) : __(selectFileLabel)}`;
label: label,
status: fileSelected || pathSelected ? selectedLabel : selectFileLabel,
});
} }
const formBody = ( const formBody = (
<> <>