diff --git a/src/components/entity/users/UserForm.js b/src/components/entity/users/UserForm.js
index 4fd562f..37cd4f6 100644
--- a/src/components/entity/users/UserForm.js
+++ b/src/components/entity/users/UserForm.js
@@ -1,5 +1,5 @@
-import { Text } from "react-native";
-import { useState } from "react";
+import {Text} from "react-native";
+import {useState} from "react";
import Icons from "../../UI/Icons";
import Form from "../../UI/Form";
import useLoad from "../../API/useLoad";
@@ -15,7 +15,7 @@ const defaultUser = {
UserImageURL: null,
};
-const UserForm = ({ originalUser, onSubmit, onCancel }) => {
+const UserForm = ({originalUser, onSubmit, onCancel}) => {
// Initialisation -------------
defaultUser.UserID = Math.floor(100000 + Math.random() * 900000);
@@ -25,11 +25,11 @@ const UserForm = ({ originalUser, onSubmit, onCancel }) => {
const yearsEndpoint = 'https://softwarehub.uk/unibase/api/years';
const levels = [
- { value: 3, label: '3 (Foundation)' },
- { value: 4, label: '4 (First Year)' },
- { value: 5, label: '5 (Second Year)' },
- { value: 6, label: '6 (Third Year)' },
- { value: 7, label: '7 (Masters)' },
+ {value: 3, label: '3 (Foundation)'},
+ {value: 4, label: '4 (First Year)'},
+ {value: 5, label: '5 (Second Year)'},
+ {value: 6, label: '6 (Third Year)'},
+ {value: 7, label: '7 (Masters)'},
];
// State ----------------------
@@ -42,7 +42,7 @@ const UserForm = ({ originalUser, onSubmit, onCancel }) => {
// Handlers -------------------
const handleChange = (field, value) => {
- setUser({ ...user, [field]: value });
+ setUser({...user, [field]: value});
};
const handleSubmit = () => onSubmit(user);
@@ -50,7 +50,7 @@ const UserForm = ({ originalUser, onSubmit, onCancel }) => {
// View -----------------------
const submitLabel = originalUser ? 'Modify' : 'Add';
- const submitIcon = originalUser ? : ;
+ const submitIcon = originalUser ? : ;
const usertypeOptions = userTypes.map((usertype) => ({
value: usertype.UsertypeID,
diff --git a/src/components/entity/users/UserItem.js b/src/components/entity/users/UserItem.js
index 0f79d02..2b5110c 100644
--- a/src/components/entity/users/UserItem.js
+++ b/src/components/entity/users/UserItem.js
@@ -1,7 +1,7 @@
-import { StyleSheet, Text, View, Pressable } from "react-native";
+import {StyleSheet, Text, View, Pressable} from "react-native";
import useLoad from "../../API/useLoad";
-const UserItem = ({ user, onSelect }) => {
+const UserItem = ({user, onSelect}) => {
// Initialisation -------------
const usertypesEndpoint = 'https://softwarehub.uk/unibase/api/usertypes';
@@ -17,6 +17,7 @@ const UserItem = ({ user, onSelect }) => {
// State ----------------------
// Handlers -------------------
// View -----------------------
+
return (
onSelect(user)}>
diff --git a/src/components/entity/users/UserView.js b/src/components/entity/users/UserView.js
index 01c8b99..832ad6e 100644
--- a/src/components/entity/users/UserView.js
+++ b/src/components/entity/users/UserView.js
@@ -1,19 +1,19 @@
-import { Alert, StyleSheet, Text, View } from "react-native";
+import {Alert, StyleSheet, Text, View} from "react-native";
import FullWidthImage from "react-native-fullwidth-image";
-import { Button, ButtonTray } from "../../UI/Button";
+import {Button, ButtonTray} from "../../UI/Button";
import Icons from "../../UI/Icons.js";
-const UserView = ({ user, onDelete, onModify }) => {
+const UserView = ({user, onDelete, onModify}) => {
// Initialisation -------------
const fullName = `${user.UserFirstname} ${user.UserLastname}`;
const levels = [
- { value: 3, label: '3 (Foundation)' },
- { value: 4, label: '4 (First Year)' },
- { value: 5, label: '5 (Second Year)' },
- { value: 6, label: '6 (Third Year)' },
- { value: 7, label: '7 (Masters)' },
+ {value: 3, label: '3 (Foundation)'},
+ {value: 4, label: '4 (First Year)'},
+ {value: 5, label: '5 (Second Year)'},
+ {value: 6, label: '6 (Third Year)'},
+ {value: 7, label: '7 (Masters)'},
];
// State ----------------------
@@ -26,8 +26,8 @@ const UserView = ({ user, onDelete, onModify }) => {
'Delete Warning',
`Are you sure you want to delete user ${fullName}?`,
[
- { text: 'Cancel' },
- { text: 'Delete', onPress: handleDelete }
+ {text: 'Cancel'},
+ {text: 'Delete', onPress: handleDelete}
]
);
};
@@ -38,7 +38,7 @@ const UserView = ({ user, onDelete, onModify }) => {
return (
-
+
{fullName}
@@ -51,12 +51,12 @@ const UserView = ({ user, onDelete, onModify }) => {
}
+ icon={}
label={"Modify"}
onClick={onModify}
/>
}
+ icon={}
label={"Delete"}
onClick={requestDelete}
/>
diff --git a/src/components/screens/ModuleListScreen.js b/src/components/screens/ModuleListScreen.js
index 0c7e2d5..3f5d307 100644
--- a/src/components/screens/ModuleListScreen.js
+++ b/src/components/screens/ModuleListScreen.js
@@ -11,7 +11,7 @@ const ModuleListScreen = ({navigation}) => {
// Initialisation -------------
// let modules = initialModules;
LogBox.ignoreLogs(['Non-serializable values were found in the navigation state']);
-
+
const modulesEndpoint = 'https://softwarehub.uk/unibase/api/modules';
// State ----------------------
diff --git a/src/components/screens/ModuleViewScreen.js b/src/components/screens/ModuleViewScreen.js
index 2a9da5f..09baf0c 100644
--- a/src/components/screens/ModuleViewScreen.js
+++ b/src/components/screens/ModuleViewScreen.js
@@ -11,7 +11,7 @@ export const ModuleViewScreen = ({navigation, route}) => {
// State ----------------------
// Handlers -------------------
- const goToModifyScreen = () => navigation.replace("ModuleModifyScreen", { module, onModify });
+ const goToModifyScreen = () => navigation.replace("ModuleModifyScreen", {module, onModify});
// View -----------------------
return (
diff --git a/src/components/screens/UserListScreen.js b/src/components/screens/UserListScreen.js
index 2f1b966..55adb73 100644
--- a/src/components/screens/UserListScreen.js
+++ b/src/components/screens/UserListScreen.js
@@ -1,11 +1,11 @@
-import { LogBox, Text } from "react-native";
+import {LogBox, Text} from "react-native";
import Screen from "../layout/Screen";
import UserList from "../entity/users/UserList";
-import { Button, ButtonTray } from "../UI/Button";
+import {Button, ButtonTray} from "../UI/Button";
import Icons from "../UI/Icons";
import useLoad from "../API/useLoad";
-const UserListScreen = ({ navigation }) => {
+const UserListScreen = ({navigation}) => {
// Initialisation -------------
LogBox.ignoreLogs(['Non-serializable values were found in the navigation state']);
@@ -36,14 +36,14 @@ const UserListScreen = ({ navigation }) => {
const onModify = (user) => {
handleModify(user);
- navigation.replace('UserViewScreen', { user, onDelete, onModify });
+ navigation.replace('UserViewScreen', {user, onDelete, onModify});
};
const goToViewScreen = (user) =>
- navigation.navigate('UserViewScreen', { user, onDelete, onModify });
+ navigation.navigate('UserViewScreen', {user, onDelete, onModify});
const goToAddScreen = () =>
- navigation.navigate('UserAddScreen', { onAdd });
+ navigation.navigate('UserAddScreen', {onAdd});
const handleSwitchToModules = () => {
navigation.navigate("ModuleListScreen");
@@ -53,12 +53,12 @@ const UserListScreen = ({ navigation }) => {
return (
- } onClick={goToAddScreen} />
+
{isLoading && Loading Records...}
-
+
);
};
diff --git a/src/components/screens/UserModifyScreen.js b/src/components/screens/UserModifyScreen.js
index 972f1f8..e0af66e 100644
--- a/src/components/screens/UserModifyScreen.js
+++ b/src/components/screens/UserModifyScreen.js
@@ -1,9 +1,9 @@
import Screen from "../layout/Screen";
import UserForm from "../entity/users/UserForm";
-const UserModifyScreen = ({ navigation, route }) => {
+const UserModifyScreen = ({navigation, route}) => {
// Initialisation -------------
- const { user, onModify } = route.params;
+ const {user, onModify} = route.params;
// State ----------------------
// Handlers -------------------
diff --git a/src/components/screens/UserViewScreen.js b/src/components/screens/UserViewScreen.js
index fd1b01a..f25c568 100644
--- a/src/components/screens/UserViewScreen.js
+++ b/src/components/screens/UserViewScreen.js
@@ -1,15 +1,15 @@
-import { StyleSheet } from "react-native";
+import {StyleSheet} from "react-native";
import Screen from "../layout/Screen";
import UserView from "../entity/users/UserView";
-const UserViewScreen = ({ navigation, route }) => {
+const UserViewScreen = ({navigation, route}) => {
// Initialisation -------------
- const { user, onDelete, onModify } = route.params;
+ const {user, onDelete, onModify} = route.params;
// State ----------------------
// Handlers -------------------
- const goToModifyScreen = () => navigation.replace("UserModifyScreen", { user, onModify });
+ const goToModifyScreen = () => navigation.replace("UserModifyScreen", {user, onModify});
// View -----------------------
return (