Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import styles from './styles.css'
- /**
- * @return {string}
- */
- function GetCoords(x, y) {
- /*
- const cells = [];
- for (let i = 0; i < amount; i++) {
- cells.push(<div className={ styles.cell }></div>);
- }
- */
- //calc(15px + 106.25px * 3 + 15px * 3); top: calc(15px + 106.25px + 15px)
- debugger;
- return `calc(15px + 106.25px * ${y} + 15px * ${y}); top: calc(15px + 106.25px * ${x}+ 15px * ${x})`
- //return <div className="cells">{cells}</div>;
- }
- export default class Tile extends React.Component {
- constructor({x, y, value}) {
- super()
- this.state = {
- x: x,
- y: y,
- value: value
- };
- }
- render () {
- var a = GetCoords(this.state.x, this.state.y).toString();
- debugger
- return (
- <div className= {styles.tile}
- style = {a}
- >{this.state.value}</div>
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement