Skip to content

Instantly share code, notes, and snippets.

@ThakurBallary
Created July 8, 2018 17:56
Show Gist options
  • Save ThakurBallary/549a39cd2fb5b738e852c8d2b832aadc to your computer and use it in GitHub Desktop.
Save ThakurBallary/549a39cd2fb5b738e852c8d2b832aadc to your computer and use it in GitHub Desktop.
react-native-btr-demo
import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { IconPicker } from 'react-native-btr';
class IconPickerDemo extends Component {
static navigationOptions = {
title: 'IconPicker'
}
state = {
selectedIcon: ''
}
render() {
return (
<View style={styles.container}>
<Text>Selected Icon = {this.state.selectedIcon}</Text>
<View style={styles.wrapper}>
<IconPicker
selectedIcon={this.state.selectedIcon}
onSelect={selectedIcon => this.setState({ selectedIcon })}
/>
</View>
<Text> Scroll Horizontally for more Icons </Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
wrapper: {
backgroundColor: '#fff',
marginVertical: 10
}
});
export default IconPickerDemo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment