Files
freeCodeCamp/common/app/routes/Challenges/views/project/Project.jsx
Berkeley Martinez b1e9a172a2 Feat: anon navbar (#16189)
* chore(React): %s/react-pure-render/React.PureComponent/gc

* fix(Settings): Should redirect to signup when unauthen

* feat(Development): Use SES for mail if defined

* feat(Nav): Show anon navbar when logged in

* fix(server/datasources): Make sure mailhog works if no ses keys are found

LB will use both mail settings if using both local and dev

* fix(Nav): Use text instead of icons

* fix(Nav): Make donate page open in new tab
2017-12-15 15:53:32 -06:00

79 lines
1.6 KiB
JavaScript

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { createSelector } from 'reselect';
import { connect } from 'react-redux';
import { Col, Image } from 'react-bootstrap';
import SidePanel from './Side-Panel.jsx';
import ToolPanel from './Tool-Panel.jsx';
import BugModal from '../../Bug-Modal.jsx';
import { challengeMetaSelector } from '../../redux';
import { challengeSelector } from '../../../../redux';
const mapStateToProps = createSelector(
challengeSelector,
challengeMetaSelector,
(
{
id,
description,
image
},
{ title }
) => ({
id,
image,
title,
description
})
);
const propTypes = {
description: PropTypes.arrayOf(PropTypes.string),
id: PropTypes.string,
image: PropTypes.string,
isCompleted: PropTypes.bool,
title: PropTypes.string
};
export class Project extends PureComponent {
render() {
const {
id,
title,
image,
isCompleted,
description
} = this.props;
const imageURL = '//i.imgur.com/' + image + '.png';
return (
<Col
md={ 8 }
xs={ 12 }
>
<SidePanel
description={ description }
isCompleted={ isCompleted }
title={ title }
/>
<Image
id={ id }
responsive={ true }
src={ imageURL }
/>
<br />
<ToolPanel />
<br />
<BugModal />
</Col>
);
}
}
Project.displayName = 'Project';
Project.propTypes = propTypes;
export default connect(
mapStateToProps
)(Project);