Skip to content

Instantly share code, notes, and snippets.

@ThakurBallary
Created July 8, 2018 17:54
Show Gist options
  • Save ThakurBallary/046e277708f9ab392f1bd78a1fa2db23 to your computer and use it in GitHub Desktop.
Save ThakurBallary/046e277708f9ab392f1bd78a1fa2db23 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 { ColorPicker } from 'react-native-btr';
class ColorPickerDemo extends Component {
static navigationOptions = {
title: 'ColorPicker'
}
state = {
selectedColor: ''
}
render() {
return (
<View style={styles.container}>
<Text>Selected Color = {this.state.selectedColor}</Text>
<View style={styles.wrapper}>
<ColorPicker
selectedColor={this.state.selectedColor}
onSelect={selectedColor => this.setState({ selectedColor })}
/>
</View>
<Text> Scroll Horizontally for more colors </Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
wrapper: {
backgroundColor: '#fff',
marginVertical: 10
}
});
export default ColorPickerDemo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment