diff --git a/src/routes/Publish/Files/index.tsx b/src/routes/Publish/Files/index.tsx index 1f774ea..6b582ef 100644 --- a/src/routes/Publish/Files/index.tsx +++ b/src/routes/Publish/Files/index.tsx @@ -9,7 +9,9 @@ import styles from './index.module.scss' interface FilesProps { files: string[] placeholder: string - help: string + help?: string + name: string + onChange: any // resetForm: any } @@ -40,11 +42,20 @@ export default class Files extends PureComponent { public render() { const { isFormShown } = this.state - const { files, help, placeholder } = this.props + const { files, help, placeholder, name, onChange } = this.props return ( <> - {help} + {help && {help}} + + {/* Use hidden input to collect files */} + +
{files.length > 0 && ( { ) @@ -95,7 +97,7 @@ class Publish extends Component<{}, PublishState> { event: ChangeEvent | ChangeEvent ) => { this.setState({ - [event.target.name]: event.target.value + [event.currentTarget.name]: event.currentTarget.value }) } @@ -103,7 +105,7 @@ class Publish extends Component<{}, PublishState> { event: ChangeEvent | ChangeEvent ) => { this.setState({ - [event.target.name]: [event.target.value] + [event.currentTarget.name]: [event.currentTarget.value] }) }