update lbry-redux

This commit is contained in:
Sean Yesmunt 2019-09-23 11:02:30 -04:00
parent 0958b84861
commit 6a1b7dfc1e
6 changed files with 44 additions and 49 deletions

View file

@ -128,7 +128,7 @@
"husky": "^0.14.3",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#2b3a5a59907f34d4e1c005c4696282b58d626242",
"lbry-redux": "lbryio/lbry-redux#6bd56492ad15a0e761b087db29a5441e9b9a04f0",
"lbryinc": "lbryio/lbryinc#f8bba34b34599a8450ced842b29336d1117d050d",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",

View file

@ -13,8 +13,8 @@ import ChannelPage from './view';
const select = (state, props) => ({
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),
page: selectCurrentChannelPage(state),
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),

View file

@ -9,8 +9,8 @@ type Props = {
claim: ChannelClaim,
title: ?string,
amount: string,
cover: ?string,
thumbnail: ?string,
coverUrl: ?string,
thumbnailUrl: ?string,
location: { search: string },
description: string,
website: string,
@ -29,11 +29,11 @@ function ChannelForm(props: Props) {
const {
claim,
title,
cover,
coverUrl,
description,
website,
email,
thumbnail,
thumbnailUrl,
tags,
locations,
languages,
@ -47,21 +47,21 @@ function ChannelForm(props: Props) {
// fill this in with sdk data
const channelParams = {
website: website,
email: email,
website,
email,
coverUrl,
thumbnailUrl,
description,
title,
amount,
claim_id: claimId,
languages: languages || [],
cover: cover,
description: description,
locations: locations || [],
title: title,
thumbnail: thumbnail,
tags: tags
? tags.map(tag => {
return { name: tag };
})
: [],
claim_id: claimId,
amount: amount,
};
const [params, setParams] = useState(channelParams);
@ -88,14 +88,14 @@ function ChannelForm(props: Props) {
}
};
const handleThumbnailChange = (url: string) => {
setParams({ ...params, thumbnail: url });
updateThumb(url);
const handleThumbnailChange = (thumbnailUrl: string) => {
setParams({ ...params, thumbnailUrl });
updateThumb(thumbnailUrl);
};
const handleCoverChange = (url: string) => {
setParams({ ...params, cover: url });
updateCover(url);
const handleCoverChange = (coverUrl: string) => {
setParams({ ...params, coverUrl });
updateCover(coverUrl);
};
// TODO clear and bail after submit
return (
@ -108,17 +108,22 @@ function ChannelForm(props: Props) {
)}
</p>
</div>
<Form onSubmit={channelParams => updateChannel(channelParams)}>
<Form
onSubmit={() => {
updateChannel(params);
setEditing(false);
}}
>
<SelectAsset
onUpdate={v => handleThumbnailChange(v)}
currentValue={params.thumbnail}
currentValue={params.thumbnailUrl}
assetName={'Thumbnail'}
recommended={'(300 x 300)'}
/>
<SelectAsset
onUpdate={v => handleCoverChange(v)}
currentValue={params.cover}
currentValue={params.coverUrl}
assetName={'Cover'}
recommended={'(1000 x 160)'}
/>
@ -196,22 +201,8 @@ function ChannelForm(props: Props) {
tagsChosen={params.tags || []}
/>
<div className={'card__actions'}>
<Button
button="primary"
label={__('Submit')}
onClick={() => {
updateChannel(params);
setEditing(false);
}}
/>
<Button
button="link"
label={__('Cancel')}
onClick={() => {
setParams({ ...channelParams });
setEditing(false);
}}
/>
<Button button="primary" label={__('Submit')} type="submit" />
<Button button="link" label={__('Cancel')} />
</div>
</Form>
</section>

View file

@ -47,7 +47,7 @@ class ChannelSection extends React.PureComponent<Props, State> {
}
componentDidMount() {
const { channels, fetchChannelListMine, fetchingChannels } = this.props;
const { channels = [], fetchChannelListMine, fetchingChannels } = this.props;
if (!channels.length && !fetchingChannels) {
fetchChannelListMine();
}
@ -165,11 +165,12 @@ class ChannelSection extends React.PureComponent<Props, State> {
value={channel}
>
<option value={CHANNEL_ANONYMOUS}>{__('Anonymous')}</option>
{channels.map(({ name }) => (
<option key={name} value={name}>
{name}
</option>
))}
{channels &&
channels.map(({ name }) => (
<option key={name} value={name}>
{name}
</option>
))}
<option value={CHANNEL_NEW}>{__('New channel...')}</option>
</FormField>
</fieldset-section>

View file

@ -702,5 +702,8 @@
"For users with good bandwidth, try a higher value to improve streaming and download speeds. Low bandwidth users may benefit from a lower setting. Default is 4.": "For users with good bandwidth, try a higher value to improve streaming and download speeds. Low bandwidth users may benefit from a lower setting. Default is 4.",
"This will clear the application cache. Your wallet will not be affected. Currently, followed tags and blocked channels will be cleared.": "This will clear the application cache. Your wallet will not be affected. Currently, followed tags and blocked channels will be cleared.",
"Show All": "Show All",
"Get ??? LBC": "Get ??? LBC"
"Get ??? LBC": "Get ??? LBC",
"to fix it. If that doesn't work, press CMD/CTRL-R to reset to the homepage.": "to fix it. If that doesn't work, press CMD/CTRL-R to reset to the homepage.",
"LBRY names cannot contain spaces or reserved symbols ($#@;/\"<>%{}|^~[]`)": "LBRY names cannot contain spaces or reserved symbols ($#@;/\"<>%{}|^~[]`)",
"Creating channel...": "Creating channel..."
}

View file

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