From cd0719631ea917fa13ccbce1dd1462e1ef635ec1 Mon Sep 17 00:00:00 2001
From: Andrea Magnussen <andrea@magnussen.net>
Date: Tue, 15 Jun 2021 11:28:09 +0200
Subject: [PATCH] Documented camera screens

---
 screens/camera/CameraScreen.js             |  9 +++++++++
 screens/camera/RegisterSalamanderScreen.js | 10 ++++++++++
 2 files changed, 19 insertions(+)

diff --git a/screens/camera/CameraScreen.js b/screens/camera/CameraScreen.js
index dfea32f..0ebb2d2 100644
--- a/screens/camera/CameraScreen.js
+++ b/screens/camera/CameraScreen.js
@@ -23,6 +23,15 @@ import { toast500, toastError } from "../../constants/toasts";
 
 const deviceWidth = Dimensions.get("window").width;
 
+/**
+ * This component renders the camera screen. This screen consists of an image picker, which makes the user able to upload images from their phones
+ * library. It also consists of a built-in camera, where the user can take a photo while in the application. The user might need to grant premission for 
+ * the app to be able to use the camera. 
+ * 
+ * @param {*} props - used for redux and navigation. 
+ * 
+ * @returns the component
+ */
 const _CameraScreen = (props) => {
 
   const [isCameraMode, setShowCamera] = useState(false);
diff --git a/screens/camera/RegisterSalamanderScreen.js b/screens/camera/RegisterSalamanderScreen.js
index c106d6a..16291ce 100644
--- a/screens/camera/RegisterSalamanderScreen.js
+++ b/screens/camera/RegisterSalamanderScreen.js
@@ -36,6 +36,16 @@ const species = [
 const sexValues = {firstValue:"female", secondValue:"male", thirdValue:"juvenile", 
 firstText:"Female", secondText:"Male", thirdText:"Juvenile"};
 
+/**
+ * This component renders the screen where the user can register a new salamander entry. When the user has provided all mandatory data, 
+ * the salamander will be matched agaist the other registered salamander with the same data (location, species, sex). If there is a match, 
+ * a green popup screen will show, providing information about which salamander it was matched with. If there was no match, a white poput will show, 
+ * and a new salamander will be registered in the database with a new ID. 
+ * 
+ * @param {*} props - used for redux, navigation and route to get data from the previous screen.
+ * 
+ * @returns the component.
+ */
 const _RegisterSalamanderScreen = (props) => {
   const { salamanderSex, salamanderSpecies, image } = props.route.params;
   const { userReducer, updateLocations, addLastLocation } = props;
-- 
GitLab