// @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 PublishReleaseDate from 'component/publishReleaseDate'; import LicenseType from './license-type'; import Card from 'component/common/card'; import SUPPORTED_LANGUAGES from 'constants/supported_languages'; import { sortLanguageMap } from 'util/default-languages'; type Props = { language: ?string, name: ?string, licenseType: ?string, otherLicenseDescription: ?string, licenseUrl: ?string, disabled: boolean, updatePublishForm: ({}) => void, }; function PublishAdditionalOptions(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({ languages: [event.target.value] })} > {sortLanguageMap(SUPPORTED_LANGUAGES).map(([langKey, langName]) => ( ))} updatePublishForm({ licenseType: newLicenseType, licenseUrl: newLicenseUrl, }) } handleLicenseDescriptionChange={(event) => updatePublishForm({ otherLicenseDescription: event.target.value, }) } handleLicenseUrlChange={(event) => updatePublishForm({ licenseUrl: event.target.value })} />
)}
} /> ); } export default PublishAdditionalOptions;