// @flow import React from 'react'; import classnames from 'classnames'; import usePersistedState from 'util/use-persisted-state'; import { FormField } from 'component/common/form'; import Button from 'component/button'; import LicenseType from './license-type'; type Props = { language: ?string, name: ?string, licenseType: ?string, otherLicenseDescription: ?string, licenseUrl: ?string, disabled: boolean, updatePublishForm: ({}) => void, }; function PublishAdvanced(props: Props) { const { language, name, licenseType, otherLicenseDescription, licenseUrl, updatePublishForm } = props; const [hideSection, setHideSection] = usePersistedState('publish-advanced-options', true); function toggleHideSection() { setHideSection(!hideSection); } return (
{!hideSection && (
updatePublishForm({ language: event.target.value })} > updatePublishForm({ licenseType: newLicenseType, licenseUrl: newLicenseUrl, }) } handleLicenseDescriptionChange={event => updatePublishForm({ otherLicenseDescription: event.target.value, }) } handleLicenseUrlChange={event => updatePublishForm({ licenseUrl: event.target.value })} />
)}
); } export default PublishAdvanced;