Fix tic-tac-toe example is OSS

Summary: flex: 1 is no longer correct

Reviewed By: emilsjolander

Differential Revision: D4182840

fbshipit-source-id: 912119c09d887d545a28d2855c5583f1d8d7c93e
This commit is contained in:
Andy Street 2016-11-21 09:53:40 -08:00 коммит произвёл Facebook Github Bot
Родитель 8576865252
Коммит ec467fbd34
1 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -1,4 +1,11 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
@ -95,7 +102,7 @@ class Board {
}
class Cell extends React.Component {
cellStyle = () => {
cellStyle() {
switch (this.props.player) {
case 1:
return styles.cellX;
@ -104,9 +111,9 @@ class Cell extends React.Component {
default:
return null;
}
};
}
textStyle = () => {
textStyle() {
switch (this.props.player) {
case 1:
return styles.cellTextX;
@ -115,9 +122,9 @@ class Cell extends React.Component {
default:
return {};
}
};
}
textContents = () => {
textContents() {
switch (this.props.player) {
case 1:
return 'X';
@ -126,7 +133,7 @@ class Cell extends React.Component {
default:
return '';
}
};
}
render() {
return (
@ -258,7 +265,6 @@ var styles = StyleSheet.create({
borderRadius: 5,
backgroundColor: '#7b8994',
margin: 5,
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},