From 6a1b7dfc1e13aba6342d6e80cc4d648a3dd9fda5 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 23 Sep 2019 11:02:30 -0400 Subject: [PATCH] update lbry-redux --- package.json | 2 +- src/ui/component/channelEdit/index.js | 4 +- src/ui/component/channelEdit/view.jsx | 65 +++++++++++-------------- src/ui/component/selectChannel/view.jsx | 13 ++--- static/locales/en.json | 5 +- yarn.lock | 4 +- 6 files changed, 44 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index 37f835547..fabc5e750 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/ui/component/channelEdit/index.js b/src/ui/component/channelEdit/index.js index 6f0617eea..d5dc8fc80 100644 --- a/src/ui/component/channelEdit/index.js +++ b/src/ui/component/channelEdit/index.js @@ -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), diff --git a/src/ui/component/channelEdit/view.jsx b/src/ui/component/channelEdit/view.jsx index 71603ff9e..725e2389d 100644 --- a/src/ui/component/channelEdit/view.jsx +++ b/src/ui/component/channelEdit/view.jsx @@ -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) { )}

-
updateChannel(channelParams)}> + { + updateChannel(params); + setEditing(false); + }} + > handleThumbnailChange(v)} - currentValue={params.thumbnail} + currentValue={params.thumbnailUrl} assetName={'Thumbnail'} recommended={'(300 x 300)'} /> 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 || []} />
-
diff --git a/src/ui/component/selectChannel/view.jsx b/src/ui/component/selectChannel/view.jsx index 5d9eb6ae8..dec2e2491 100644 --- a/src/ui/component/selectChannel/view.jsx +++ b/src/ui/component/selectChannel/view.jsx @@ -47,7 +47,7 @@ class ChannelSection extends React.PureComponent { } 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 { value={channel} > - {channels.map(({ name }) => ( - - ))} + {channels && + channels.map(({ name }) => ( + + ))} diff --git a/static/locales/en.json b/static/locales/en.json index 412602c55..f42fc68ef 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -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..." } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index eaef3ed01..46f88806e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"