diff --git a/src/components/entity/users/UserView.js b/src/components/entity/users/UserView.js index 7ee7040..0d91e18 100644 --- a/src/components/entity/users/UserView.js +++ b/src/components/entity/users/UserView.js @@ -1,9 +1,9 @@ -import { StyleSheet, Text, View } from "react-native"; +import { Alert, StyleSheet, Text, View } from "react-native"; import FullWidthImage from "react-native-fullwidth-image"; -import Icons from "../../UI/Icons"; -import { ListItem } from "../../UI/List"; +import { Button, ButtonTray } from "../../UI/Button"; +import Icons from "../../UI/Icons.js"; -const UserItem = ({ user, onSelect }) => { +const UserView = ({ user, onDelete, onModify }) => { // Initialisation ------------- const fullName = `${user.UserFirstname} ${user.UserLastname}`; @@ -11,38 +11,59 @@ const UserItem = ({ user, onSelect }) => { // State ---------------------- // Handlers ------------------- - const handleSelect = () => onSelect(user); + const handleDelete = () => onDelete(user); + + const requestDelete = () => { + Alert.alert( + 'Delete Warning', + `Are you sure you want to delete user ${fullName}?`, + [ + { text: 'Cancel' }, + { text: 'Delete', onPress: handleDelete } + ] + ); + }; // View ----------------------- return ( - - + + - {fullName} + View {fullName} {user.UserEmail} + Level {user.UserLevel} - {user.UserUsertypeName || 'Unknown Type'} - (Level {user.UserLevel}) + {user.UserUsertypeName || 'Unknown Type'} (User Type) - - + +