import React from ‘react’
import { View , StyleSheet, SafeAreaView ,FlatList} from ‘react-native’
import Icon from ‘…/components/Icon’
import ListItem from ‘…/components/lists/ListItem’
import colors from ‘…/config/colors’
import Screen from “…/components/Screen”
import ListItemSeperator from ‘…/components/lists/ListItemSeperator’
const menuItems = [
{
title: "My Listings",
icon: {
name: "format-list-bulleted",
backgroundColor: colors.primary,
}
},
{
title: "My Messages",
icon: {
name: "email",
backgroundColor: colors.secondary,
}
}
]
function AccountScreen(props) {
return (
<Screen style={styles.body}>
<View style={styles.container}>
<ListItem
title="Veraat Gupta"
subTitle="guptasgurgaon@gmail.com"
image={require("../assets/mosh.jpg")}
/>
</View>
<View style={styles.container}>
<FlatList
data={menuItems}
keyExtractor={menuItem => menuItem.title}
ItemSeparatorComponent={ListItemSeperator}
renderItem= {({ item }) =>
<ListItem
title={item.title}
ImageComponent={
<Icon
name= {item.icon.name}
backgroundColor= {item.icon.backgroundColor}
size= {46}/>
}
/>
}
/>
</View>
<View style={styles.container}>
<ListItem
title= "Logout"
ImageComponent={
<Icon
name= "logout"
backgroundColor= {colors.log_out}
size={46}/>
}
/>
</View>
</Screen>
)
}
const styles = StyleSheet.create({
container: {
marginHorizontal: 0 ,
padding:0,
marginVertical: 20,
width: "100%",
},
body: {
backgroundColor: colors.light,
},
user:{
width: "100%",
},
listing: {
backgroundColor: colors.white,
}
})
export default AccountScreen