forked from lottie-react-native/lottie-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExamplePicker.js
More file actions
39 lines (36 loc) · 854 Bytes
/
Copy pathExamplePicker.js
File metadata and controls
39 lines (36 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* eslint-disable global-require */
import React, { PropTypes } from 'react';
import {
Picker,
Platform,
} from 'react-native';
const propTypes = {
example: PropTypes.any,
onChange: PropTypes.func,
examples: PropTypes.any,
};
export default class ExamplePicker extends React.Component {
render() {
return (
<Picker
selectedValue={this.props.example}
onValueChange={this.props.onChange}
style={{
marginBottom: Platform.select({
ios: -30,
android: 0,
}),
}}
>
{Object.keys(this.props.examples).map(name => this.props.examples[name]).map(ex => (
<Picker.Item
key={ex.name}
label={ex.name}
value={ex.name}
/>
))}
</Picker>
);
}
}
ExamplePicker.propTypes = propTypes;