Codeminer42/cm42-central

View on GitHub
app/assets/javascripts/components/story/CollapsedStory/CollapsedStoryEstimateButton.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import { connect } from 'react-redux';
import ProjectPropTypes from '../../shapes/project';

export const CollapsedStoryEstimateButton = ({ project, onUpdate }) => (
  <div className="Story__estimate-box">
    {project.pointValues.map(value => (
      <span
        className="Story__estimate"
        key={`estimate-${value}`}
        data-value={value}
        onClick={() => onUpdate(value)}
      >
        {value}
      </span>
    ))}
  </div>
);

CollapsedStoryEstimateButton.propTypes = {
  project: ProjectPropTypes.isRequired,
};

const mapStateToProps = ({ project }) => ({ project });

export default connect(mapStateToProps)(CollapsedStoryEstimateButton);