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", "husky": "^0.14.3",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git", "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", "lbryinc": "lbryio/lbryinc#f8bba34b34599a8450ced842b29336d1117d050d",
"lint-staged": "^7.0.2", "lint-staged": "^7.0.2",
"localforage": "^1.7.1", "localforage": "^1.7.1",

View file

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

View file

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

View file

@ -47,7 +47,7 @@ class ChannelSection extends React.PureComponent<Props, State> {
} }
componentDidMount() { componentDidMount() {
const { channels, fetchChannelListMine, fetchingChannels } = this.props; const { channels = [], fetchChannelListMine, fetchingChannels } = this.props;
if (!channels.length && !fetchingChannels) { if (!channels.length && !fetchingChannels) {
fetchChannelListMine(); fetchChannelListMine();
} }
@ -165,11 +165,12 @@ class ChannelSection extends React.PureComponent<Props, State> {
value={channel} value={channel}
> >
<option value={CHANNEL_ANONYMOUS}>{__('Anonymous')}</option> <option value={CHANNEL_ANONYMOUS}>{__('Anonymous')}</option>
{channels.map(({ name }) => ( {channels &&
<option key={name} value={name}> channels.map(({ name }) => (
{name} <option key={name} value={name}>
</option> {name}
))} </option>
))}
<option value={CHANNEL_NEW}>{__('New channel...')}</option> <option value={CHANNEL_NEW}>{__('New channel...')}</option>
</FormField> </FormField>
</fieldset-section> </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.", "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.", "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", "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" yargs "^13.2.2"
zstd-codec "^0.1.1" zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#2b3a5a59907f34d4e1c005c4696282b58d626242: lbry-redux@lbryio/lbry-redux#6bd56492ad15a0e761b087db29a5441e9b9a04f0:
version "0.0.1" 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: dependencies:
proxy-polyfill "0.1.6" proxy-polyfill "0.1.6"
reselect "^3.0.0" reselect "^3.0.0"