Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix(file-input): improve children prop-type to allow multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric authored and varl committed Nov 25, 2019
1 parent 85d40ba commit e7785fd
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/FileInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import propTypes from 'prop-types'
import cx from 'classnames'
import { instanceOfComponent } from '@dhis2/prop-types'

import { statusPropType, sizePropType } from '../common-prop-types'
import { Button } from '../Button'
import { Help } from '../Help'
import { spacers, colors } from '../theme'
Expand Down Expand Up @@ -98,7 +99,11 @@ class FileInput extends PureComponent {
}

const childPropType = propTypes.oneOfType([
instanceOfComponent(SelectedFile),
propTypes.oneOfType([
instanceOfComponent(SelectedFile),
propTypes.arrayOf(instanceOfComponent(SelectedFile)),
]),
instanceOfComponent(Placeholder),
instanceOfComponent(Help),
])

Expand All @@ -113,9 +118,12 @@ FileInput.propTypes = {
propTypes.arrayOf(childPropType),
]),

error: propTypes.bool,
valid: propTypes.bool,
warning: propTypes.bool,
error: statusPropType,
valid: statusPropType,
warning: statusPropType,

small: sizePropType,
large: sizePropType,

required: propTypes.bool,

Expand Down

0 comments on commit e7785fd

Please sign in to comment.