Skip to content
Snippets Groups Projects
Commit 2e7979a4 authored by john's avatar john
Browse files

make upload warning message dynamic

parent 8f2a2e69
No related branches found
No related tags found
No related merge requests found
...@@ -75,13 +75,15 @@ export class UploadButton extends React.Component { ...@@ -75,13 +75,15 @@ export class UploadButton extends React.Component {
if (!this.isLocked()) return null if (!this.isLocked()) return null
const { showModal } = this.state const { showModal } = this.state
const { modalContainer } = this.props const { chapter, modalContainer } = this.props
const type = chapter.subCategory
return ( return (
<UploadWarningModal <UploadWarningModal
container={modalContainer} container={modalContainer}
show={showModal} show={showModal}
toggle={this.toggleModal} toggle={this.toggleModal}
type={type}
/> />
) )
} }
......
...@@ -4,9 +4,11 @@ import AbstractModal from '../../common/AbstractModal' ...@@ -4,9 +4,11 @@ import AbstractModal from '../../common/AbstractModal'
class UploadWarningModal extends React.Component { class UploadWarningModal extends React.Component {
renderBody () { renderBody () {
const { type } = this.props
return ( return (
<div> <div>
You are not allowed to import contents while a chapter is being edited. You are not allowed to import contents while a { type } is being edited.
</div> </div>
) )
} }
...@@ -31,7 +33,8 @@ class UploadWarningModal extends React.Component { ...@@ -31,7 +33,8 @@ class UploadWarningModal extends React.Component {
UploadWarningModal.propTypes = { UploadWarningModal.propTypes = {
container: React.PropTypes.object.isRequired, container: React.PropTypes.object.isRequired,
show: React.PropTypes.bool.isRequired, show: React.PropTypes.bool.isRequired,
toggle: React.PropTypes.func.isRequired toggle: React.PropTypes.func.isRequired,
type: React.PropTypes.string.isRequired
} }
export default UploadWarningModal export default UploadWarningModal
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment