import _ from 'lodash'; import React, {Component} from 'react'; import {ScrollView} from 'react-native'; import {Constants, Colors, View, Text, ColorSwatch, ColorPalette} from 'react-native-ui-lib'; //eslint-disable-line export default class ColorSwatchScreen extends Component { colors = [ 'transparent', Colors.$backgroundSuccessHeavy, Colors.$backgroundWarningHeavy, Colors.$backgroundDangerHeavy ]; mainColors = [ '#66737C', '#459FED', '#1D5382', '#3CC7C5', '#65C888', '#FAAD4D', '#F27052', '#F2564D', '#B13DAC', '#733CA6', '#79838A', '#5847FF', '#00BBF2', '#00CD8B', '#FF563D', '#ffb600' ]; allColors = _.filter(Object.values(Colors), _.isString); state = { color: this.colors[0], color1: this.mainColors[this.mainColors.length - 1], color2: this.allColors[20], selected: false }; onPress = () => { this.setState({selected: !this.state.selected}); }; onValueChange = (value: string) => { this.setState({color: value}); }; onValueChange1 = (value: string) => { this.setState({color1: value}); }; onValueChange2 = (value: string) => { this.setState({color2: value}); }; unavailableOnPress = () => { console.log(`Pressed on unavailable color swatch!`); }; render() { const {color, color1, color2, selected} = this.state; return ( Single ColorSwatch Unavailable Transparent Square ColorPalette Selected Color: {color} Scrollable Pagination ); } }