Remove Picker from XHR example

Summary: Changelog: [Internal] Remove Picker from XHR examples

Reviewed By: kacieb

Differential Revision: D29082825

fbshipit-source-id: 7616847ff5f0da59a5e38898df78c911103699ba
This commit is contained in:
Luna Wei
2021-06-15 12:21:27 -07:00
committed by Facebook GitHub Bot
parent 993d022d4b
commit 65740723d9
@@ -15,12 +15,12 @@ const React = require('react');
const {
Alert,
Linking,
Picker,
StyleSheet,
Text,
TouchableHighlight,
View,
} = require('react-native');
import RNTOption from '../../components/RNTOption';
const BINARY_TYPES = {
String,
@@ -110,14 +110,20 @@ class XHRExampleBinaryUpload extends React.Component<{...}, $FlowFixMeState> {
render(): React.Node {
return (
<View>
<Text>Upload 255 bytes as...</Text>
<Picker
selectedValue={this.state.type}
onValueChange={type => this.setState({type})}>
{Object.keys(BINARY_TYPES).map(type => (
<Picker.Item key={type} label={type} value={type} />
))}
</Picker>
<View style={styles.block}>
<Text style={styles.title}>Upload 255 bytes as ...</Text>
<View style={styles.row}>
{Object.keys(BINARY_TYPES).map(type => (
<RNTOption
selected={this.state.type === type}
key={type}
label={type}
onPress={() => this.setState({type})}
style={styles.option}
/>
))}
</View>
</View>
<View style={styles.uploadButton}>
<TouchableHighlight onPress={this._upload}>
<View style={styles.uploadButtonBox}>
@@ -131,6 +137,19 @@ class XHRExampleBinaryUpload extends React.Component<{...}, $FlowFixMeState> {
}
const styles = StyleSheet.create({
block: {
borderColor: 'rgba(0,0,0, 0.1)',
borderBottomWidth: 1,
padding: 6,
},
row: {
flexDirection: 'row',
flexWrap: 'wrap',
},
title: {
fontWeight: 'bold',
},
option: {margin: 6},
uploadButton: {
marginTop: 16,
},