import React, {Component} from 'react'; import {StyleSheet, Alert, FlatList} from 'react-native'; import {Colors, BorderRadiuses, View, Image, ListItem, Text} from 'react-native-ui-lib'; import orders, {OrderType} from '../../data/orders'; export default class BasicListScreen extends Component { keyExtractor = (item: OrderType) => item.name; renderRow(row: OrderType, id: number) { const statusColor = row.inventory.status === 'Paid' ? Colors.green30 : Colors.red30; return ( Alert.alert(`pressed on order #${id + 1}`)} > {row.name} {row.formattedPrice} {`${row.inventory.quantity} item`} {row.inventory.status} ); } render() { return ( this.renderRow(item, index)} keyExtractor={this.keyExtractor} /> ); } } const styles = StyleSheet.create({ image: { width: 54, height: 54, borderRadius: BorderRadiuses.br20, marginHorizontal: 14 }, border: { borderBottomWidth: StyleSheet.hairlineWidth, borderColor: Colors.grey70 } });