Codemod to 1.7.0

Differential Revision: D5763302

fbshipit-source-id: a91ca1786c7ac8eb9aa3dd43555a7a223dc6f9cf
This commit is contained in:
Christopher Chedeau
2017-09-26 23:33:30 -07:00
committed by Facebook Github Bot
parent 888c6e7eac
commit 70c6700be8
14 changed files with 106 additions and 131 deletions

View File

@@ -48,16 +48,12 @@ class CameraRollExample extends React.Component<
onValueChange={this._onSwitchChange}
value={this.state.bigImages}
/>
<Text>
{(this.state.bigImages ? 'Big' : 'Small') + ' Images'}
</Text>
<Text>{(this.state.bigImages ? 'Big' : 'Small') + ' Images'}</Text>
<Slider
value={this.state.sliderValue}
onValueChange={this._onSliderChange}
/>
<Text>
{'Group Type: ' + this.state.groupTypes}
</Text>
<Text>{'Group Type: ' + this.state.groupTypes}</Text>
<CameraRollView
ref={ref => {
this._cameraRollView = ref;
@@ -93,18 +89,10 @@ class CameraRollExample extends React.Component<
<View style={styles.row}>
<Image source={asset.node.image} style={imageStyle} />
<View style={styles.info}>
<Text style={styles.url}>
{asset.node.image.uri}
</Text>
<Text>
{locationStr}
</Text>
<Text>
{asset.node.group_name}
</Text>
<Text>
{new Date(asset.node.timestamp).toString()}
</Text>
<Text style={styles.url}>{asset.node.image.uri}</Text>
<Text>{locationStr}</Text>
<Text>{asset.node.group_name}</Text>
<Text>{new Date(asset.node.timestamp).toString()}</Text>
</View>
</View>
</TouchableOpacity>

View File

@@ -70,9 +70,7 @@ class EventCheckBoxExample extends React.Component<{}, $FlowFixMeState> {
style={{marginBottom: 10}}
value={this.state.eventCheckBoxIsOn}
/>
<Text>
{this.state.eventCheckBoxIsOn ? 'On' : 'Off'}
</Text>
<Text>{this.state.eventCheckBoxIsOn ? 'On' : 'Off'}</Text>
</View>
<View>
<CheckBox
@@ -87,9 +85,7 @@ class EventCheckBoxExample extends React.Component<{}, $FlowFixMeState> {
style={{marginBottom: 10}}
value={this.state.eventCheckBoxRegressionIsOn}
/>
<Text>
{this.state.eventCheckBoxRegressionIsOn ? 'On' : 'Off'}
</Text>
<Text>{this.state.eventCheckBoxRegressionIsOn ? 'On' : 'Off'}</Text>
</View>
</View>
);

View File

@@ -38,16 +38,10 @@ const WS_STATES = [
class Button extends React.Component {
render(): React.Element<any> {
const label = (
<Text style={styles.buttonLabel}>
{this.props.label}
</Text>
);
const label = <Text style={styles.buttonLabel}>{this.props.label}</Text>;
if (this.props.disabled) {
return (
<View style={[styles.button, styles.disabledButton]}>
{label}
</View>
<View style={[styles.button, styles.disabledButton]}>{label}</View>
);
}
return (
@@ -62,14 +56,8 @@ class Row extends React.Component {
render(): React.Element<any> {
return (
<View style={styles.row}>
<Text>
{this.props.label}
</Text>
{this.props.value
? <Text>
{this.props.value}
</Text>
: null}
<Text>{this.props.label}</Text>
{this.props.value ? <Text>{this.props.value}</Text> : null}
{this.props.children}
</View>
);