Last active
April 20, 2022 23:39
-
-
Save xiongemi/2e51de1afb90881d0f6867f523bd8a89 to your computer and use it in GitHub Desktop.
nx react native zodiac-sign-list.tsx with data passed in
This file contains hidden or 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 { | |
| AdhZodiacSignItem, | |
| AdhZodiacSignList, | |
| } from '@aztro-daily-horoscope/models'; | |
| import React from 'react'; | |
| import { FlatList } from 'react-native'; | |
| import { ListItem } from '@rneui/base'; | |
| import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; | |
| export function ZodiacSignList() { | |
| const keyExtractor = (item: AdhZodiacSignItem) => item.zodiacSign; | |
| return ( | |
| <FlatList | |
| keyExtractor={keyExtractor} | |
| data={AdhZodiacSignList} | |
| renderItem={({ item }) => ( | |
| <ListItem bottomDivider> | |
| <Icon name={item.icon} /> | |
| <ListItem.Content> | |
| <ListItem.Title>{item.zodiacSign}</ListItem.Title> | |
| </ListItem.Content> | |
| <ListItem.Chevron /> | |
| </ListItem> | |
| )} | |
| /> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment