2016-08-30 03:23:10 +00:00
|
|
|
import React, { PropTypes } from 'react';
|
|
|
|
import { reduxForm } from 'redux-form';
|
|
|
|
import InlineSVG from 'react-inlinesvg';
|
|
|
|
import NewFolderForm from './NewFolderForm';
|
|
|
|
|
2017-02-22 19:29:35 +00:00
|
|
|
const exitUrl = require('../../../images/exit.svg');
|
|
|
|
|
2016-11-30 00:18:11 +00:00
|
|
|
class NewFolderModal extends React.Component {
|
|
|
|
componentDidMount() {
|
2017-02-22 19:29:35 +00:00
|
|
|
this.newFolderModal.focus();
|
2016-11-30 00:18:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2017-02-22 19:29:35 +00:00
|
|
|
<section className="modal" ref={(element) => { this.newFolderModal = element; }} tabIndex="0">
|
2016-11-30 00:18:11 +00:00
|
|
|
<div className="modal-content-folder">
|
|
|
|
<div className="modal__header">
|
|
|
|
<h2 className="modal__title">Add Folder</h2>
|
|
|
|
<button className="modal__exit-button" onClick={this.props.closeModal}>
|
|
|
|
<InlineSVG src={exitUrl} alt="Close New Folder Modal" />
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<NewFolderForm {...this.props} />
|
2016-08-30 03:23:10 +00:00
|
|
|
</div>
|
2016-11-30 00:18:11 +00:00
|
|
|
</section>
|
|
|
|
);
|
|
|
|
}
|
2016-08-30 03:23:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NewFolderModal.propTypes = {
|
|
|
|
closeModal: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default reduxForm({
|
|
|
|
form: 'new-folder',
|
|
|
|
fields: ['name']
|
|
|
|
})(NewFolderModal);
|
|
|
|
|