You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
793 B
28 lines
793 B
import { View, Text, StyleSheet } from "react-native"
|
|
import { FlatList } from "react-native-gesture-handler"
|
|
import { CITIES_DATA, City } from "./data/stub"
|
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
|
|
|
export default function CityList(props: any){
|
|
const insets = useSafeAreaInsets();
|
|
const statusBarHeight = insets.top;
|
|
|
|
return (
|
|
<View style={{alignItems: "center", marginTop: statusBarHeight}}>
|
|
<FlatList
|
|
data={CITIES_DATA}
|
|
keyExtractor={item =>item.name}
|
|
renderItem={({item}) => <Text>{item.name}</Text>}
|
|
style={{width: "100%", alignSelf: "center"}}
|
|
/>
|
|
</View>
|
|
)
|
|
}
|
|
|
|
|
|
const leStyle = StyleSheet.create({
|
|
container: {
|
|
alignItems: 'center',
|
|
},
|
|
}); |