2016-06-03 18:37:53 -07:00
|
|
|
import React, { PropTypes } from 'react';
|
|
|
|
import { createSelector } from 'reselect';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import PureComponent from 'react-pure-render/component';
|
2017-07-31 20:04:01 -07:00
|
|
|
import { Col, Image } from 'react-bootstrap';
|
2016-10-29 00:46:45 +01:00
|
|
|
|
2016-06-07 20:41:42 -07:00
|
|
|
import SidePanel from './Side-Panel.jsx';
|
|
|
|
import ToolPanel from './Tool-Panel.jsx';
|
2017-03-13 16:17:07 -07:00
|
|
|
import BugModal from '../../Bug-Modal.jsx';
|
2016-06-03 18:37:53 -07:00
|
|
|
|
2017-07-31 20:04:01 -07:00
|
|
|
import { challengeMetaSelector } from '../../redux';
|
|
|
|
import { challengeSelector } from '../../../../redux';
|
2016-06-03 18:37:53 -07:00
|
|
|
|
|
|
|
const mapStateToProps = createSelector(
|
|
|
|
challengeSelector,
|
2017-07-31 20:04:01 -07:00
|
|
|
challengeMetaSelector,
|
2016-06-03 18:37:53 -07:00
|
|
|
(
|
|
|
|
{
|
2017-07-31 20:04:01 -07:00
|
|
|
id,
|
|
|
|
description,
|
|
|
|
image
|
|
|
|
},
|
|
|
|
{ title }
|
2016-06-03 18:37:53 -07:00
|
|
|
) => ({
|
|
|
|
id,
|
2017-06-03 14:29:37 +05:30
|
|
|
image,
|
2016-06-03 18:37:53 -07:00
|
|
|
title,
|
2016-06-07 20:41:42 -07:00
|
|
|
description
|
2016-06-03 18:37:53 -07:00
|
|
|
})
|
|
|
|
);
|
2017-01-12 06:54:43 +00:00
|
|
|
const propTypes = {
|
|
|
|
description: PropTypes.arrayOf(PropTypes.string),
|
|
|
|
id: PropTypes.string,
|
2017-06-03 14:29:37 +05:30
|
|
|
image: PropTypes.string,
|
2017-01-12 06:54:43 +00:00
|
|
|
isCompleted: PropTypes.bool,
|
2017-06-03 14:29:37 +05:30
|
|
|
title: PropTypes.string
|
2017-01-12 06:54:43 +00:00
|
|
|
};
|
2016-06-03 18:37:53 -07:00
|
|
|
|
|
|
|
export class Project extends PureComponent {
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
id,
|
|
|
|
title,
|
2017-06-03 14:29:37 +05:30
|
|
|
image,
|
2016-06-03 18:37:53 -07:00
|
|
|
isCompleted,
|
2016-06-07 20:41:42 -07:00
|
|
|
description
|
2016-06-03 18:37:53 -07:00
|
|
|
} = this.props;
|
2017-06-03 14:29:37 +05:30
|
|
|
const imageURL = '//i.imgur.com/' + image + '.png';
|
2016-06-03 18:37:53 -07:00
|
|
|
return (
|
2017-07-31 20:04:01 -07:00
|
|
|
<Col
|
|
|
|
md={ 8 }
|
|
|
|
xs={ 12 }
|
|
|
|
>
|
|
|
|
<SidePanel
|
|
|
|
description={ description }
|
|
|
|
isCompleted={ isCompleted }
|
|
|
|
title={ title }
|
|
|
|
/>
|
|
|
|
<Image
|
|
|
|
id={ id }
|
|
|
|
responsive={ true }
|
|
|
|
src={ imageURL }
|
|
|
|
/>
|
|
|
|
<br />
|
|
|
|
<ToolPanel />
|
|
|
|
<br />
|
|
|
|
<BugModal />
|
|
|
|
</Col>
|
2016-06-03 18:37:53 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-12 06:54:43 +00:00
|
|
|
Project.displayName = 'Project';
|
|
|
|
Project.propTypes = propTypes;
|
|
|
|
|
2016-06-03 18:37:53 -07:00
|
|
|
export default connect(
|
2016-06-07 20:41:42 -07:00
|
|
|
mapStateToProps
|
2016-06-03 18:37:53 -07:00
|
|
|
)(Project);
|