I work with the 'react-native-super-grid' library and I trying to figure out how to do the following 2 situations:
Displays a different icon for each item in the gridfor example : the PinIcon will be for the 'qq' and the CatIcon will be for the 'ww'.
How to make the items clickable with 'pressable' or 'TouchableOpacity'
import React from 'react';import { StyleSheet, Text, View } from 'react-native';import { createStackNavigator } from '@react-navigation/stack';import { FlatGrid } from 'react-native-super-grid';import PinIcon from '../src/assets/PinIcon.svg';import CatIcon from '../src/assets/CatIcon.svg'; const HomeComponent = () => { const [items, setItems] = React.useState([ { name: 'qq', code: 'white' }, { name: 'ww', code: 'white' }, { name: `ee`, code: 'white' }, { name: 'rr', code: 'white' }, { name: 'tt', code: 'white' }, { name: 'yy', code: 'white' }, { name: 'uu', code: 'white' }, ]); return (<FlatGrid itemDimension={130} data={items} style={styles.gridView} spacing={10} renderItem={({ item }) => (<View style={[styles.itemContainer, { backgroundColor: item.code }]}><PinIcon /><CatIcon /><Text style={styles.itemName}>{item.name}</Text><Text style={styles.itemCode}>{item.code}</Text></View> )} /> );};