better handle channel thumbnail upload and remove spee.ch text

This commit is contained in:
Sean Yesmunt 2020-07-22 11:24:51 -04:00
parent edbcbd9e37
commit ed1ee8ac98
4 changed files with 9 additions and 19 deletions

View file

@ -303,7 +303,6 @@
"However, you can get a longer version of this URL for any bid": "However, you can get a longer version of this URL for any bid",
"It looks like you haven't published anything to LBRY yet.": "It looks like you haven't published anything to LBRY yet.",
"Publish something new": "Publish something new",
"View it on spee.ch": "View it on spee.ch",
"New thumbnail": "New thumbnail",
"Follow": "Follow",
"Claim sequence must be a number.": "Claim sequence must be a number.",
@ -315,7 +314,6 @@
"Upload Thumbnail": "Upload Thumbnail",
"Confirm Thumbnail Upload": "Confirm Thumbnail Upload",
"Upload": "Upload",
"Are you sure you want to upload this thumbnail to spee.ch": "Are you sure you want to upload this thumbnail to spee.ch",
"Uploading thumbnail": "Uploading thumbnail",
"Please wait for thumbnail to finish uploading": "Please wait for thumbnail to finish uploading",
"API connection string": "API connection string",
@ -737,7 +735,6 @@
"Your deposit must be higher": "Your deposit must be higher",
"%view_count% views": "%view_count% views",
"1 view": "1 view",
"Upload your thumbnail to %speech_link%. Recommended size is 16:9.": "Upload your thumbnail to %speech_link%. Recommended size is 16:9.",
"Get %amount% LBC": "Get %amount% LBC",
"Get %range% LBC": "Get %range% LBC",
"Did something go wrong? Have a look in your log file, or send it to %support_link%.": "Did something go wrong? Have a look in your log file, or send it to %support_link%.",
@ -745,7 +742,6 @@
"%amount% fee": "%amount% fee",
"1 file hidden due to your %content_viewing_preferences_link%": "1 file hidden due to your %content_viewing_preferences_link%",
"Thumbnail": "Thumbnail",
"spee.ch": "spee.ch",
"This Week": "This Week",
"This Month": "This Month",
"This Year": "This Year",

View file

@ -66,6 +66,7 @@ function SelectAsset(props: Props) {
.then(json => (json.success ? onSuccess(`${json.data.serveUrl}`) : uploadError(json.message)))
.catch(err => {
uploadError(err.message);
setUploadStatus(SPEECH_READY);
});
}

View file

@ -1,13 +1,13 @@
// @flow
import * as MODALS from 'constants/modal_types';
import { Lbry, THUMBNAIL_STATUSES } from 'lbry-redux';
import { DOMAIN } from 'config';
import * as React from 'react';
import { FormField } from 'component/common/form';
import FileSelector from 'component/common/file-selector';
import Button from 'component/button';
import ThumbnailMissingImage from './thumbnail-missing.png';
import ThumbnailBrokenImage from './thumbnail-broken.png';
import I18nMessage from 'component/i18nMessage';
type Props = {
filePath: ?string,
@ -111,7 +111,7 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
type="text"
name="content_thumbnail"
label="URL"
placeholder="https://spee.ch/mylogo"
placeholder="https://images.fbi.gov/alien"
value={thumbnail}
disabled={formDisabled}
onChange={this.handleThumbnailChange}
@ -141,7 +141,7 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
<div className="column__item thumbnail-preview" style={{ backgroundImage: `url(${thumbnail})` }} />
<div className="column__item">
<p>
Upload complete. <Button button="link" href={thumbnail} label={__('View it on spee.ch')} />.
Upload complete. <Button button="link" href={thumbnail} label={__('View thumbnail')} />.
</p>
<div className="card__actions">
<Button button="link" label={__('New thumbnail')} onClick={resetThumbnailStatus} />
@ -170,17 +170,9 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
{status === THUMBNAIL_STATUSES.IN_PROGRESS && <p>{__('Uploading thumbnail')}...</p>}
<p className="help">
{status === THUMBNAIL_STATUSES.API_DOWN ? (
__('Enter a URL for your thumbnail.')
) : (
<I18nMessage
tokens={{
speech_link: <Button button="link" label="spee.ch" href="https://spee.ch/about" />,
}}
>
Upload your thumbnail to %speech_link%. Recommended size is 16:9.
</I18nMessage>
)}
{status === THUMBNAIL_STATUSES.API_DOWN
? __('Enter a URL for your thumbnail.')
: __('Upload your thumbnail to %domain%. Recommended size is 16:9.', { domain: DOMAIN })}
</p>
</div>
);

View file

@ -1,6 +1,7 @@
// @flow
import React from 'react';
import { Modal } from 'modal/modal';
import { DOMAIN } from 'config';
type Props = {
upload: WebFile => void,
@ -30,7 +31,7 @@ class ModalConfirmThumbnailUpload extends React.PureComponent<Props> {
onConfirmed={() => this.upload()}
onAborted={closeModal}
>
<p>{__('Are you sure you want to upload this thumbnail to spee.ch')}?</p>
<label>{__('Are you sure you want to upload this thumbnail to %domain%', { domain: DOMAIN })}?</label>
<blockquote>{file.path || file.name}</blockquote>
</Modal>