pablorc/snaaake

View on GitHub
www/js/components/maze.jsx

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

import React from 'react';
import ReactDOM from 'react-dom';

class Maze extends React.Component {
  getStyles() {
    const pixelSize = 15;

    return {
      width:  `${this.props.width * pixelSize}px`,
      height: `${this.props.height * pixelSize}px`
    };
  }

  render() {
    return (
      <div className="maze" style={this.getStyles()}>
        {this.props.children}
      </div>
    );
  }
}

export default Maze;