Skip to content

Commit bf8ae44

Browse files
committed
disable feature on file u ploader container
1 parent 0e4bab0 commit bf8ae44

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

components/FileUploader/FileUploaderContainer.cjsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ mapStateToProps = (state) ->
1515

1616
container =
1717
propTypes:
18-
id : PropTypes.string.isRequired
19-
assetType: PropTypes.string.isRequired
20-
category : PropTypes.string.isRequired
21-
dispatch : PropTypes.func.isRequired
22-
loading : PropTypes.bool
18+
id : PropTypes.string.isRequired
19+
assetType : PropTypes.string.isRequired
20+
category : PropTypes.string.isRequired
21+
dispatch : PropTypes.func.isRequired
22+
loading : PropTypes.bool
23+
dragAndDrop : PropTypes.bool
24+
disableClick: PropTypes.bool
2325

2426
onChange: (files) ->
2527
{ dispatch, id, assetType, category } = this.props
@@ -30,9 +32,9 @@ container =
3032
render: ->
3133
{ onChange } = this
3234

33-
{ loading } = this.props
35+
{ loading, dragAndDrop, disableClick } = this.props
3436

35-
createElement FileUploader, { onChange, loading }
37+
createElement FileUploader, { onChange, loading, dragAndDrop, disableClick }
3638

3739
module.exports = connect(mapStateToProps)(createClass(container))
3840

components/FileUploader/FileUploaderContainerExamples.cjsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ FileUploaderContainerExamples = ->
88
<h1>Default</h1>
99

1010
<FileUploaderContainer/>
11+
12+
<h1>disableClick is true</h1>
13+
14+
<FileUploaderContainer disableClick={true}/>
15+
16+
<h1>disableClick and dragAndDrop is true</h1>
17+
18+
<FileUploaderContainer disableClick={true} dragAndDrop={true}/>
1119
</div>
1220

1321
module.exports = FileUploaderContainerExamples

0 commit comments

Comments
 (0)