// @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 (
updatePublishForm({ title: e.target.value })} /> updatePublishForm({ description: advancedEditor ? value : value.target.text })} />
); } export default PublishText;