mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
v2: prepare to move
This commit is contained in:
parent
dc7ef96849
commit
45736200b0
172 changed files with 0 additions and 0 deletions
36
v2/website/components/Tictactoe/board.js
Normal file
36
v2/website/components/Tictactoe/board.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
import React from 'react';
|
||||
import Square from './square';
|
||||
import styles from './styles.css';
|
||||
|
||||
export default class Board extends React.Component {
|
||||
renderSquare(i) {
|
||||
return (
|
||||
<Square
|
||||
value={this.props.squares[i]}
|
||||
onClick={() => this.props.onClick(i)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<div className={styles.boardRow}>
|
||||
{this.renderSquare(0)}
|
||||
{this.renderSquare(1)}
|
||||
{this.renderSquare(2)}
|
||||
</div>
|
||||
<div className={styles.boardRow}>
|
||||
{this.renderSquare(3)}
|
||||
{this.renderSquare(4)}
|
||||
{this.renderSquare(5)}
|
||||
</div>
|
||||
<div className={styles.boardRow}>
|
||||
{this.renderSquare(6)}
|
||||
{this.renderSquare(7)}
|
||||
{this.renderSquare(8)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue