import React, {Component} from 'react'; import {Alert} from 'react-native'; import {Chip, Colors, Spacings, Text, Typography, View, Image} from 'react-native-ui-lib'; const avatarImage = { uri: 'https://randomuser.me/api/portraits/women/24.jpg' }; const checkmark = require('../../assets/icons/check-small.png'); const chevron = require('../../assets/icons/chevronDown.png'); const bell = require('../../assets/icons/bell.png'); export default class ChipScreen extends Component { colors = [ {value: Colors.red10, label: 'Red'}, {value: Colors.blue10, label: 'Blue'}, {value: Colors.purple10, label: 'Purple'}, {value: Colors.green10, label: 'Green'}, {value: Colors.yellow10, label: 'Yellow'} ]; state = { selectedValue: this.colors[2].label }; renderExample = (text: string, chip: JSX.Element) => { return ( {text} {chip} ); }; render() { return ( Chip Default {this.renderExample('Label', )} {this.renderExample('Label + onPress', Alert.alert('onPress')}/>)} {this.renderExample('Label + onDismiss', Alert.alert('onDismiss')} onPress={() => Alert.alert('onPress')} dismissIconStyle={{width: 10, height: 10}} />)} {this.renderExample('Icon', )} {this.renderExample('Left icon', )} {this.renderExample('Right icon', )} {this.renderExample('Label + Avatar', )} {this.renderExample('Label + Counter', )} {this.renderExample('Label + Badge', )} Custom Alert.alert('onDismiss')} dismissIconStyle={{width: 10, height: 10, marginRight: Spacings.s3}} dismissColor={Colors.red20} containerStyle={{ borderColor: Colors.red20, borderBottomRightRadius: 0, marginLeft: Spacings.s3 }} /> } label={'Chip'} /> } leftElement={} label={'Chip'} /> } label={'Chip'} /> } label={'Chip'} /> ); } }