Created
July 8, 2018 17:54
-
-
Save ThakurBallary/046e277708f9ab392f1bd78a1fa2db23 to your computer and use it in GitHub Desktop.
react-native-btr-demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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