// @flow import React from 'react'; import classnames from 'classnames'; import usePersistedState from 'effects/use-persisted-state'; import { FormField } from 'component/common/form'; import Button from 'component/button'; import LicenseType from './license-type'; import Card from 'component/common/card'; 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;