mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-30 08:51:24 +00:00
* point change email button to faq arcticle until we add that functionality * hide claims if they are blocked * fix: sorting on 'library' page * add @reach/tooltip * cleanup and add tags to publish page * fix: button color * fix: PublishPrice props * fix: claim list sorting * update lbry-redux * respond to PR comments
51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
// @flow
|
|
import React from 'react';
|
|
import { FormField } from 'component/common/form';
|
|
import Button from 'component/button';
|
|
import usePersistedState from 'util/use-persisted-state';
|
|
|
|
type Props = {
|
|
title: ?string,
|
|
description: ?string,
|
|
disabled: boolean,
|
|
updatePublishForm: ({}) => void,
|
|
};
|
|
|
|
function PublishText(props: Props) {
|
|
const { title, description, updatePublishForm, disabled } = props;
|
|
const [advancedEditor, setAdvancedEditor] = usePersistedState('publish-form-description-mode', false);
|
|
function toggleMarkdown() {
|
|
setAdvancedEditor(!advancedEditor);
|
|
}
|
|
|
|
return (
|
|
<section className="card card--section">
|
|
<div className="card__content">
|
|
<FormField
|
|
type="text"
|
|
name="content_title"
|
|
label={__('Title')}
|
|
placeholder={__('Titular Title')}
|
|
disabled={disabled}
|
|
value={title}
|
|
onChange={e => updatePublishForm({ title: e.target.value })}
|
|
/>
|
|
|
|
<FormField
|
|
type={advancedEditor ? 'markdown' : 'textarea'}
|
|
name="content_description"
|
|
label={__('Description')}
|
|
placeholder={__('My description for this and that')}
|
|
value={description}
|
|
disabled={disabled}
|
|
onChange={value => updatePublishForm({ description: advancedEditor ? value : value.target.text })}
|
|
/>
|
|
<div className="card__actions">
|
|
<Button button="link" onClick={toggleMarkdown} label={advancedEditor ? 'Simple Editor' : 'Advanced Editor'} />
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|
|
|
|
export default PublishText;
|