From bb1b9232b9b98242efefbee2828e021bbcbb936e Mon Sep 17 00:00:00 2001
From: Andrea Magnussen <andrea@magnussen.net>
Date: Tue, 15 Jun 2021 11:40:07 +0200
Subject: [PATCH] Documented the home screens

---
 screens/home/EditLocationScreen.js     | 8 ++++++++
 screens/home/HomeScreen.js             | 9 +++++++++
 screens/home/RegisterLocationScreen.js | 8 ++++++++
 3 files changed, 25 insertions(+)

diff --git a/screens/home/EditLocationScreen.js b/screens/home/EditLocationScreen.js
index e590c99..f6b9513 100644
--- a/screens/home/EditLocationScreen.js
+++ b/screens/home/EditLocationScreen.js
@@ -24,6 +24,14 @@ import {
 } from "../../constants/inputRequirements";
 import { toast500, toastError, toastSuccess } from "../../constants/toasts";
 
+/**
+ * This component renders the screen where a user can edit an existing location. The user can either edit the name, the radius or, if there
+ * are no salamanders at the given location, delete the location from the system. 
+ * 
+ * @param {*} props - used for redux, navigation and route to get data from the previous screen.
+ *  
+ * @returns the component
+ */
 const _EditLocationScreen = (props) => {
   const { locationId, locationName, locationRadius } = props.route.params;
 
diff --git a/screens/home/HomeScreen.js b/screens/home/HomeScreen.js
index 9c3c77f..a9616bf 100644
--- a/screens/home/HomeScreen.js
+++ b/screens/home/HomeScreen.js
@@ -8,6 +8,15 @@ import { connect } from "react-redux";
 import { FAB } from "react-native-paper";
 import CustomActivityIndicator from "../../components/CustomActivityIndicator";
 
+/**
+ * This component renders the home screen. This screen consists primarily of a map, and the user can either register a new location or edit an
+ * existing one from this screen. The user can also see all registered locations, and if they have given permission to the app to use their location, 
+ * their current location will be shown on the map. 
+ * 
+ * @param {*} props - used for redux and navigation. 
+ * 
+ * @returns the component. 
+ */
 const _HomeScreen = (props) => {
   const { userReducer, updateLocations } = props;
 
diff --git a/screens/home/RegisterLocationScreen.js b/screens/home/RegisterLocationScreen.js
index 63708d9..1a19f09 100644
--- a/screens/home/RegisterLocationScreen.js
+++ b/screens/home/RegisterLocationScreen.js
@@ -24,6 +24,14 @@ import {
 } from "../../constants/inputRequirements";
 import { toast500, toastError, toastSuccess } from "../../constants/toasts";
 
+/**
+ * This component renders the screen where a user can register a new location. The user will have to provide a name and a radius for the 
+ * new location. When the location is approved, the user will be taken back to the home screen. 
+ * 
+ * @param {*} props - used for redux, navigation and route to get data from the previous screen.
+ * 
+ * @returns the component. 
+ */
 const _RegisterLocationScreen = (props) => {
   const { longitude, latitude } = props.route.params;
 
-- 
GitLab