Skip to content
Snippets Groups Projects
Commit 280fcadf authored by Andrea Magnussen's avatar Andrea Magnussen
Browse files

Added messages if manage and pending are empty

parent 7ed1384c
No related branches found
No related tags found
1 merge request!69Resolve "Refactor app"
......@@ -36,7 +36,7 @@ const ManageUser = (props) => {
<View style={styles.buttons}>
<CustomButton
style={styles.button}
mode="outlined"
mode="contained"
title="Edit"
onPress={() => showDialog()}
/>
......
......@@ -119,7 +119,7 @@ const _ManageSalamandersScreen = (props) => {
<CustomButton
style={styles.buttonFetch}
title="Search"
mode="outlined"
mode="contained"
onPress={() => getSalamanders()}
disabled={locationValue == null}
icon="magnify"
......@@ -133,7 +133,7 @@ const _ManageSalamandersScreen = (props) => {
<CustomButton
style={styles.buttonClose}
title="Done"
mode="contained"
mode="outlined"
onPress={() => {
removeSalamanderList();
props.navigation.navigate("Profile");
......
import React, { useState, useEffect } from "react";
import { StyleSheet, View, SafeAreaView, FlatList } from "react-native";
import { StyleSheet, View, SafeAreaView, FlatList, Text } from "react-native";
import CustomButton from "../../components/CustomButton";
import APIKit from "../../APIkit";
import CustomActivityIndicator from "../../components/CustomActivityIndicator";
import ManageUser from "../../components/ManageUser";
import { toastError, toast500 } from "../../constants/toasts";
import { Colors } from "react-native-paper"
const ManageUsersScreen = ({ navigation }) => {
const [users, setUsers] = useState([]);
......@@ -50,6 +51,11 @@ const ManageUsersScreen = ({ navigation }) => {
return (
<SafeAreaView style={{ flex: 1, alignItems: "stretch", marginTop: 15 }}>
<CustomActivityIndicator style={styles.activityIndicator} visible={showIndicator} />
{users.length === 0 && (
<View style={styles.textContainer}>
<Text style={styles.text}>There are currently no users to manage.</Text>
</View>
)}
<FlatList
data={users}
renderItem={renderItem}
......@@ -58,7 +64,7 @@ const ManageUsersScreen = ({ navigation }) => {
<View style={{ flex: 1 }}>
<CustomButton
style={styles.button}
mode="contained"
mode="outlined"
title="Done"
onPress={() => navigation.navigate("Profile")}
/>
......@@ -75,4 +81,12 @@ const styles = StyleSheet.create({
alignSelf: "center",
marginTop: 20,
},
textContainer: {
marginTop: 50,
alignSelf:"center"
},
text: {
fontSize: 16,
color: Colors.grey700
}
});
......@@ -4,6 +4,7 @@ import {
View,
FlatList,
SafeAreaView,
Text
} from "react-native";
import CustomButton from "../../components/CustomButton";
......@@ -11,6 +12,7 @@ import APIKit from "../../APIkit";
import CustomActivityIndicator from "../../components/CustomActivityIndicator";
import PendingUser from "../../components/PendingUser";
import { toast500, toastError } from "../../constants/toasts";
import { Colors } from "react-native-paper"
const PendingUsersScreen = ({ navigation }) => {
const [pendingUsers, setPendingUsers] = useState([]);
......@@ -53,6 +55,11 @@ const PendingUsersScreen = ({ navigation }) => {
return (
<SafeAreaView style={{ flex: 1, alignItems: "stretch" }}>
<CustomActivityIndicator style={styles.activityIndicator} visible={showIndicator} />
{pendingUsers.length === 0 && (
<View style={styles.textContainer}>
<Text style={styles.text}>There are currently no pending users.</Text>
</View>
)}
<FlatList
data={pendingUsers}
renderItem={renderItem}
......@@ -61,7 +68,7 @@ const PendingUsersScreen = ({ navigation }) => {
<View style={{ flex: 1 }}>
<CustomButton
style={styles.button}
mode="contained"
mode="outlined"
title="Done"
onPress={() => navigation.navigate("Profile")}
/>
......@@ -78,4 +85,12 @@ const styles = StyleSheet.create({
alignSelf: "center",
marginTop: 20,
},
textContainer: {
marginTop: 50,
alignSelf:"center"
},
text: {
fontSize: 16,
color: Colors.grey700
}
});
......@@ -340,11 +340,6 @@ const styles = StyleSheet.create({
marginEnd: 30,
marginStart: 30,
},
dropdown: {
marginStart: 20,
marginEnd: 20,
margin: 10,
},
text: {
marginStart: 20,
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment