ESPTrainer built with Meteor and React

Square.jsx 414B

123456789101112131415
  1. import React, { PropTypes } from 'react';
  2. import './styles/Square';
  3. const Square = ({color, click, highlighted, active}) =>
  4. <button className={classNames('square', color, { highlighted, disabled: !active })}
  5. onClick={click} disabled={!active}/>;
  6. Square.propTypes = {
  7. color: PropTypes.string.isRequired,
  8. click: PropTypes.func,
  9. highlighted: PropTypes.bool,
  10. active: PropTypes.bool
  11. };
  12. export default Square;