Skip to content

Commit

Permalink
Remove Picker from XHR example
Browse files Browse the repository at this point in the history
Summary: Changelog: [Internal] Remove Picker from XHR examples

Reviewed By: kacieb

Differential Revision: D29082825

fbshipit-source-id: 7616847ff5f0da59a5e38898df78c911103699ba
  • Loading branch information
Luna Wei authored and facebook-github-bot committed Jun 15, 2021
1 parent 993d022 commit 6574072
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions packages/rn-tester/js/examples/XHR/XHRExampleBinaryUpload.js
Expand Up @@ -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,
Expand Down Expand Up @@ -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}>
Expand All @@ -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,
},
Expand Down

0 comments on commit 6574072

Please sign in to comment.