diff --git a/package.json b/package.json index dbb36af77..5f0088c03 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "jsmediatags": "^3.8.1", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#bb82aed61a5569e565daa784eb25fc1d639c0c22", + "lbry-redux": "lbryio/lbry-redux#b07dfa172a526aa5e09af57bb6cf33790c8d0c91", "lbryinc": "lbryio/lbryinc#a93596c51c8fb0a226cb84df04c26a6bb60a45fb", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/src/ui/component/channelEdit/view.jsx b/src/ui/component/channelEdit/view.jsx index 1ecae9291..a65d33e4e 100644 --- a/src/ui/component/channelEdit/view.jsx +++ b/src/ui/component/channelEdit/view.jsx @@ -5,6 +5,7 @@ import { Form, FormField } from 'component/common/form'; import Button from 'component/button'; import SelectAsset from '../selectAsset/view'; +import TagSelect from '../tagsSelect/view'; type Props = { uri: string, @@ -59,7 +60,11 @@ function ChannelForm(props: Props) { locations: locations || [], title: title, thumbnail: thumbnail, - tags: tags || [], + tags: tags + ? tags.map(tag => { + return { name: tag }; + }) + : [], claim_id: claimId, amount: amount, }; @@ -177,6 +182,25 @@ function ChannelForm(props: Props) { disabled={false} onChange={text => setParams({ ...params, description: text })} /> + { + if (!params.tags.map(savedTag => savedTag.name).includes(newTag.name)) { + setParams({ ...params, tags: [...params.tags, newTag] }); + } else { + // If it already exists and the user types it in, remove it + setParams({ ...params, tags: params.tags.filter(tag => tag.name !== newTag.name) }); + } + }} + onRemove={clickedTag => { + const newTags = params.tags.slice().filter(tag => tag.name !== clickedTag.name); + setParams({ ...params, tags: newTags }); + }} + tagsChosen={params.tags || []} + />