mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
fix pressing enter on channel edit page for adding tags
This commit is contained in:
parent
aa69b227bd
commit
66c6ec1626
1 changed files with 99 additions and 101 deletions
|
@ -1,6 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Form, FormField } from 'component/common/form';
|
import { FormField } from 'component/common/form';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import SelectAsset from 'component/selectAsset';
|
import SelectAsset from 'component/selectAsset';
|
||||||
import TagsSelect from 'component/tagsSelect';
|
import TagsSelect from 'component/tagsSelect';
|
||||||
|
@ -98,15 +98,14 @@ function ChannelForm(props: Props) {
|
||||||
setParams({ ...params, coverUrl });
|
setParams({ ...params, coverUrl });
|
||||||
updateCover(coverUrl);
|
updateCover(coverUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleSubmit = () => {
|
||||||
|
updateChannel(params);
|
||||||
|
setEditing(false);
|
||||||
|
};
|
||||||
// TODO clear and bail after submit
|
// TODO clear and bail after submit
|
||||||
return (
|
return (
|
||||||
<section className={'card--section'}>
|
<section className={'card--section'}>
|
||||||
<Form
|
|
||||||
onSubmit={() => {
|
|
||||||
updateChannel(params);
|
|
||||||
setEditing(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<SelectAsset
|
<SelectAsset
|
||||||
onUpdate={v => handleThumbnailChange(v)}
|
onUpdate={v => handleThumbnailChange(v)}
|
||||||
currentValue={params.thumbnailUrl}
|
currentValue={params.thumbnailUrl}
|
||||||
|
@ -198,10 +197,9 @@ function ChannelForm(props: Props) {
|
||||||
tagsChosen={params.tags || []}
|
tagsChosen={params.tags || []}
|
||||||
/>
|
/>
|
||||||
<div className={'card__actions'}>
|
<div className={'card__actions'}>
|
||||||
<Button button="primary" label={__('Submit')} type="submit" />
|
<Button button="primary" label={__('Submit')} onClick={handleSubmit} />
|
||||||
<Button button="link" label={__('Cancel')} navigate={`$/${PAGES.CHANNELS}`} />
|
<Button button="link" label={__('Cancel')} navigate={`$/${PAGES.CHANNELS}`} />
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue