mirror of
https://github.com/mudabbir-ahmad/Project-MAD-crudler.git
synced 2026-10-07 20:40:20 +00:00
Refactoring a lot of the user items to use the USER data from the API, as it keeps a very similar structure to module.
This commit is contained in:
1 parent
755d568090
commit
07e04884af
8 files changed
+231
-191
No files matched your search
@@ -1,25 +1,24 @@
|
||||
import {StyleSheet, Text, View, Pressable} from "react-native";
|
||||
import { StyleSheet, Text, View, Pressable } from "react-native";
|
||||
|
||||
const UserItem = ({user, onSelect}) => {
|
||||
// Initialisation -------------
|
||||
// State ----------------------
|
||||
// Handlers -------------------
|
||||
// View -----------------------
|
||||
const UserItem = ({ user, onSelect }) => {
|
||||
// Initialisation -------------
|
||||
// State ----------------------
|
||||
// Handlers -------------------
|
||||
// View -----------------------
|
||||
|
||||
return (
|
||||
<Pressable key={user.UserCode} onPress={() => onSelect(user)}>
|
||||
<View style={styles.usersItem}>
|
||||
<Pressable key={user.UserID} onPress={() => onSelect(user)}>
|
||||
<View style={styles.userItem}>
|
||||
<Text style={styles.text}>
|
||||
{user.UserCode} {user.UserName}
|
||||
`${user.UserFirstname} ${user.UserLastname}`
|
||||
</Text>
|
||||
</View>
|
||||
</Pressable>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
usersItem: {
|
||||
userItem: {
|
||||
paddingVertical: 15,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: "lightgray",
|
||||
@@ -29,4 +28,4 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
});
|
||||
|
||||
export default UserItem;
|
||||
export default UserItem;
|
||||
Reference in new issue
Block a user