ESPTrainer built with Meteor and React

Square.jsx 463B

123456789101112131415161718
  1. import React, { Component, PropTypes } from 'react';
  2. import './styles/Square';
  3. export default class Square extends Component {
  4. render() {
  5. const classes = classNames('square', this.props.color, { 'highlighted': this.props.highlighted });
  6. return (
  7. <button className={classes} style={this.style}
  8. onClick={this.props.click} />
  9. );
  10. }
  11. }
  12. Square.propTypes = {
  13. color: PropTypes.string.isRequired,
  14. click: PropTypes.func,
  15. highlighted: PropTypes.bool
  16. };