fix thumbnail/cover edits

This commit is contained in:
Sean Yesmunt 2020-07-02 13:39:29 -04:00
parent 9952359e28
commit f4310cd3aa
4 changed files with 23 additions and 21 deletions

View file

@ -21,8 +21,8 @@ import ChannelPage from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
title: makeSelectTitleForUri(props.uri)(state),
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
cover: makeSelectCoverForUri(props.uri)(state),
thumbnailUrl: makeSelectThumbnailForUri(props.uri)(state),
coverUrl: makeSelectCoverForUri(props.uri)(state),
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),

View file

@ -21,8 +21,8 @@ type Props = {
claim: ChannelClaim,
title: string,
amount: string,
cover: string,
thumbnail: string,
coverUrl: string,
thumbnailUrl: string,
location: { search: string },
description: string,
website: string,
@ -53,8 +53,8 @@ function ChannelForm(props: Props) {
description,
website,
email,
thumbnail,
cover,
thumbnailUrl,
coverUrl,
tags,
locations,
languages,
@ -81,8 +81,8 @@ function ChannelForm(props: Props) {
const channelParams: {
website: string,
email: string,
cover: string,
thumbnail: string,
coverUrl: string,
thumbnailUrl: string,
description: string,
title: string,
amount: number,
@ -93,8 +93,8 @@ function ChannelForm(props: Props) {
} = {
website,
email,
cover,
thumbnail,
coverUrl,
thumbnailUrl,
description,
title,
amount: 0.001,
@ -133,11 +133,11 @@ function ChannelForm(props: Props) {
}
function handleThumbnailChange(thumbnailUrl: string) {
setParams({ ...params, thumbnail: thumbnailUrl });
setParams({ ...params, thumbnailUrl });
}
function handleCoverChange(coverUrl: string) {
setParams({ ...params, cover: coverUrl });
setParams({ ...params, coverUrl });
}
function handleSubmit() {
@ -180,16 +180,16 @@ function ChannelForm(props: Props) {
openModal(MODALS.IMAGE_UPLOAD, {
onUpdate: coverUrl => handleCoverChange(coverUrl),
title: __('Edit Cover Image'),
helpText: __('(Y x Z)'),
helpText: __('(6.25:1)'),
assetName: __('Cover Image'),
currentValue: params.cover,
currentValue: params.coverUrl,
})
}
icon={ICONS.CAMERA}
iconSize={18}
/>
</div>
{params.cover && <img className="channel-cover__custom" src={params.cover} />}
{params.coverUrl && <img className="channel-cover__custom" src={params.coverUrl} />}
<div className="channel__primary-info">
<div className="channel__edit-thumb">
<Button
@ -199,9 +199,9 @@ function ChannelForm(props: Props) {
openModal(MODALS.IMAGE_UPLOAD, {
onUpdate: v => handleThumbnailChange(v),
title: __('Edit Thumbnail Image'),
helpText: __('(Y x Z)'),
helpText: __('(1:1)'),
assetName: __('Thumbnail'),
currentValue: params.thumbnail,
currentValue: params.thumbnailUrl,
})
}
icon={ICONS.CAMERA}
@ -211,7 +211,7 @@ function ChannelForm(props: Props) {
<ChannelThumbnail
className="channel__thumbnail--channel-page"
uri={uri}
thumbnailPreview={params.thumbnail}
thumbnailPreview={params.thumbnailUrl}
allowGifs
/>
<h1 className="channel__title">
@ -357,6 +357,7 @@ function ChannelForm(props: Props) {
<div className="section__actions">
<Button
button="primary"
disabled={creatingChannel || updatingChannel}
label={creatingChannel || updatingChannel ? __('Submitting') : __('Submit')}
onClick={handleSubmit}
/>

View file

@ -90,6 +90,7 @@ function SelectAsset(props: Props) {
/>
) : (
<FileSelector
autoFocus
disabled={uploadStatus === SPEECH_UPLOADING}
label={uploadStatus === SPEECH_UPLOADING ? __('Uploading...') : __('File to upload')}
name="assetSelector"
@ -112,7 +113,7 @@ function SelectAsset(props: Props) {
<FormField
name="toggle-upload"
type="checkbox"
label={__('Use a URL instead')}
label={__('Use a URL')}
checked={useUrl}
onChange={() => setUseUrl(!useUrl)}
/>

View file

@ -6347,9 +6347,9 @@ lazy-val@^1.0.4:
yargs "^13.2.2"
zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#eb47b7e5b6cc24db93b2b66cf1153b02858caf58:
lbry-redux@lbryio/lbry-redux#c0bfa4d32005266d41df18a19c93914c426a8067:
version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/eb47b7e5b6cc24db93b2b66cf1153b02858caf58"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/c0bfa4d32005266d41df18a19c93914c426a8067"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"