2016-07-11 21:54:55 -07:00
|
|
|
|
import React, { PropTypes } from 'react';
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
import { Button, Modal } from 'react-bootstrap';
|
|
|
|
|
import PureComponent from 'react-pure-render/component';
|
2017-03-13 16:17:07 -07:00
|
|
|
|
|
|
|
|
|
import ns from './ns.json';
|
2017-07-31 20:04:01 -07:00
|
|
|
|
import {
|
|
|
|
|
createIssue,
|
|
|
|
|
openIssueSearch,
|
|
|
|
|
closeBugModal,
|
2017-03-13 16:17:07 -07:00
|
|
|
|
|
2017-07-31 20:04:01 -07:00
|
|
|
|
bugModalSelector
|
|
|
|
|
} from './redux';
|
2016-07-11 21:54:55 -07:00
|
|
|
|
|
2017-07-31 20:04:01 -07:00
|
|
|
|
const mapStateToProps = state => ({ isOpen: bugModalSelector(state) });
|
2017-03-13 16:17:07 -07:00
|
|
|
|
const mapDispatchToProps = { createIssue, openIssueSearch, closeBugModal };
|
2017-08-26 00:07:44 +02:00
|
|
|
|
const bugLink = 'http://forum.freecodecamp.org/t/how-to-report-a-bug/19543';
|
2016-07-11 21:54:55 -07:00
|
|
|
|
|
2017-01-12 06:54:43 +00:00
|
|
|
|
const propTypes = {
|
|
|
|
|
closeBugModal: PropTypes.func,
|
|
|
|
|
createIssue: PropTypes.func,
|
|
|
|
|
isOpen: PropTypes.bool,
|
|
|
|
|
openIssueSearch: PropTypes.func
|
|
|
|
|
};
|
|
|
|
|
|
2016-07-11 21:54:55 -07:00
|
|
|
|
export class BugModal extends PureComponent {
|
|
|
|
|
render() {
|
|
|
|
|
const {
|
|
|
|
|
isOpen,
|
|
|
|
|
closeBugModal,
|
|
|
|
|
openIssueSearch,
|
|
|
|
|
createIssue
|
|
|
|
|
} = this.props;
|
|
|
|
|
return (
|
|
|
|
|
<Modal
|
|
|
|
|
show={ isOpen }
|
|
|
|
|
>
|
2017-03-13 16:17:07 -07:00
|
|
|
|
<Modal.Header className={ `${ns}-list-header` }>
|
2016-07-11 21:54:55 -07:00
|
|
|
|
Did you find a bug?
|
2016-09-09 20:12:28 -07:00
|
|
|
|
<span
|
|
|
|
|
className='close closing-x'
|
|
|
|
|
onClick={ closeBugModal }
|
|
|
|
|
>
|
|
|
|
|
×
|
|
|
|
|
</span>
|
2016-07-11 21:54:55 -07:00
|
|
|
|
</Modal.Header>
|
|
|
|
|
<Modal.Body className='text-center'>
|
|
|
|
|
<h3>
|
|
|
|
|
Before you submit a new issue,
|
2016-12-28 19:02:34 -06:00
|
|
|
|
read "How to Report a Bug" and
|
2016-07-11 21:54:55 -07:00
|
|
|
|
browse other issues with this challenge.
|
|
|
|
|
</h3>
|
|
|
|
|
<Button
|
|
|
|
|
block={ true }
|
|
|
|
|
bsSize='lg'
|
|
|
|
|
bsStyle='primary'
|
|
|
|
|
href={ bugLink }
|
|
|
|
|
target='_blank'
|
|
|
|
|
>
|
2016-12-28 19:02:34 -06:00
|
|
|
|
Read "How to Report a Bug"
|
2016-07-11 21:54:55 -07:00
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
block={ true }
|
|
|
|
|
bsSize='lg'
|
|
|
|
|
bsStyle='primary'
|
|
|
|
|
onClick={ openIssueSearch }
|
|
|
|
|
>
|
|
|
|
|
Browse other issues with this challenge
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
block={ true }
|
|
|
|
|
bsSize='lg'
|
|
|
|
|
bsStyle='primary'
|
|
|
|
|
onClick={ createIssue }
|
|
|
|
|
>
|
2017-05-21 15:00:35 -04:00
|
|
|
|
Create topic for issue in community forum
|
2016-07-11 21:54:55 -07:00
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
block={ true }
|
|
|
|
|
bsSize='lg'
|
|
|
|
|
bsStyle='primary'
|
2016-09-09 20:12:28 -07:00
|
|
|
|
onClick={ closeBugModal }
|
2016-07-11 21:54:55 -07:00
|
|
|
|
>
|
|
|
|
|
Cancel
|
|
|
|
|
</Button>
|
|
|
|
|
</Modal.Body>
|
|
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-12 06:54:43 +00:00
|
|
|
|
BugModal.displayName = 'BugModal';
|
|
|
|
|
BugModal.propTypes = propTypes;
|
|
|
|
|
|
2017-03-13 16:17:07 -07:00
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(BugModal);
|