@@ -22,6 +22,10 @@ export default class GameBoard extends Component {
2222 } ) ;
2323 }
2424
25+ handleBackToGameList ( ) {
26+ this . props . backToGameListHandler ( ) ;
27+ }
28+
2529 renderCell ( row , col ) {
2630 let value = this . props . game . board [ row ] [ col ] ;
2731 if ( value === 0 ) return ( < td > O</ td > ) ;
@@ -32,25 +36,28 @@ export default class GameBoard extends Component {
3236 }
3337 render ( ) {
3438 return (
35- < table className = "game-board" >
36- < tbody >
37- < tr >
38- { this . renderCell ( 0 , 0 ) }
39- { this . renderCell ( 0 , 1 ) }
40- { this . renderCell ( 0 , 2 ) }
41- </ tr >
42- < tr >
43- { this . renderCell ( 1 , 0 ) }
44- { this . renderCell ( 1 , 1 ) }
45- { this . renderCell ( 1 , 2 ) }
46- </ tr >
47- < tr >
48- { this . renderCell ( 2 , 0 ) }
49- { this . renderCell ( 2 , 1 ) }
50- { this . renderCell ( 2 , 2 ) }
51- </ tr >
52- </ tbody >
53- </ table >
39+ < div >
40+ < button onClick = { this . handleBackToGameList . bind ( this ) } > Back</ button >
41+ < table className = "game-board" >
42+ < tbody >
43+ < tr >
44+ { this . renderCell ( 0 , 0 ) }
45+ { this . renderCell ( 0 , 1 ) }
46+ { this . renderCell ( 0 , 2 ) }
47+ </ tr >
48+ < tr >
49+ { this . renderCell ( 1 , 0 ) }
50+ { this . renderCell ( 1 , 1 ) }
51+ { this . renderCell ( 1 , 2 ) }
52+ </ tr >
53+ < tr >
54+ { this . renderCell ( 2 , 0 ) }
55+ { this . renderCell ( 2 , 1 ) }
56+ { this . renderCell ( 2 , 2 ) }
57+ </ tr >
58+ </ tbody >
59+ </ table >
60+ </ div >
5461 )
5562 }
5663}
0 commit comments