diff --git a/ui/component/channelEdit/view.jsx b/ui/component/channelEdit/view.jsx index 467db1bb6..8c9dccc11 100644 --- a/ui/component/channelEdit/view.jsx +++ b/ui/component/channelEdit/view.jsx @@ -1,6 +1,6 @@ // @flow import React, { useState } from 'react'; -import { Form, FormField } from 'component/common/form'; +import { FormField } from 'component/common/form'; import Button from 'component/button'; import SelectAsset from 'component/selectAsset'; import TagsSelect from 'component/tagsSelect'; @@ -98,110 +98,108 @@ function ChannelForm(props: Props) { setParams({ ...params, coverUrl }); updateCover(coverUrl); }; + + const handleSubmit = () => { + updateChannel(params); + setEditing(false); + }; // TODO clear and bail after submit return (
-
{ - updateChannel(params); - setEditing(false); + handleThumbnailChange(v)} + currentValue={params.thumbnailUrl} + assetName={'Thumbnail'} + recommended={'(300 x 300)'} + /> + + handleCoverChange(v)} + currentValue={params.coverUrl} + assetName={'Cover'} + recommended={'(1000 x 160)'} + /> + + setParams({ ...params, title: e.target.value })} + /> + handleBidChange(parseFloat(event.target.value))} + placeholder={0.1} + /> + + setParams({ ...params, website: e.target.value })} + /> + + setParams({ ...params, email: e.target.value })} + /> + + setParams({ ...params, description: text })} + /> + { + newTags.forEach(newTag => { + 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) }); + } + }); }} - > - handleThumbnailChange(v)} - currentValue={params.thumbnailUrl} - assetName={'Thumbnail'} - recommended={'(300 x 300)'} - /> - - handleCoverChange(v)} - currentValue={params.coverUrl} - assetName={'Cover'} - recommended={'(1000 x 160)'} - /> - - setParams({ ...params, title: e.target.value })} - /> - handleBidChange(parseFloat(event.target.value))} - placeholder={0.1} - /> - - setParams({ ...params, website: e.target.value })} - /> - - setParams({ ...params, email: e.target.value })} - /> - - setParams({ ...params, description: text })} - /> - { - newTags.forEach(newTag => { - 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 || []} - /> -
-
- + onRemove={clickedTag => { + const newTags = params.tags.slice().filter(tag => tag.name !== clickedTag.name); + setParams({ ...params, tags: newTags }); + }} + tagsChosen={params.tags || []} + /> +
+
); }