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';
|
|
|
|
|
import { createIssue, openIssueSearch, closeBugModal } from '../redux/actions';
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = state => ({ isOpen: state.challengesApp.isBugOpen });
|
|
|
|
|
const actions = { createIssue, openIssueSearch, closeBugModal };
|
2016-07-31 00:41:25 +01:00
|
|
|
|
const bugLink = 'http://forum.freecodecamp.com/t/how-to-report-a-bug/19543';
|
2016-07-11 21:54:55 -07:00
|
|
|
|
|
|
|
|
|
export class BugModal extends PureComponent {
|
|
|
|
|
static propTypes = {
|
|
|
|
|
isOpen: PropTypes.bool,
|
|
|
|
|
closeBugModal: PropTypes.func,
|
|
|
|
|
openIssueSearch: PropTypes.func,
|
|
|
|
|
createIssue: PropTypes.func
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const {
|
|
|
|
|
isOpen,
|
|
|
|
|
closeBugModal,
|
|
|
|
|
openIssueSearch,
|
|
|
|
|
createIssue
|
|
|
|
|
} = this.props;
|
|
|
|
|
return (
|
|
|
|
|
<Modal
|
|
|
|
|
show={ isOpen }
|
|
|
|
|
>
|
|
|
|
|
<Modal.Header className='challenge-list-header'>
|
|
|
|
|
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,
|
|
|
|
|
read "Help I've Found a Bug" and
|
|
|
|
|
browse other issues with this challenge.
|
|
|
|
|
</h3>
|
|
|
|
|
<Button
|
|
|
|
|
block={ true }
|
|
|
|
|
bsSize='lg'
|
|
|
|
|
bsStyle='primary'
|
|
|
|
|
href={ bugLink }
|
|
|
|
|
target='_blank'
|
|
|
|
|
>
|
|
|
|
|
Read "Help I've Found a Bug"
|
|
|
|
|
</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 }
|
|
|
|
|
>
|
|
|
|
|
Create my GitHub issue
|
|
|
|
|
</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>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, actions)(BugModal);
|