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

Documented the home screens

parent cd071963
No related branches found
No related tags found
1 merge request!70Resolve "Add comments to all files"
...@@ -24,6 +24,14 @@ import { ...@@ -24,6 +24,14 @@ import {
} from "../../constants/inputRequirements"; } from "../../constants/inputRequirements";
import { toast500, toastError, toastSuccess } from "../../constants/toasts"; 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 _EditLocationScreen = (props) => {
const { locationId, locationName, locationRadius } = props.route.params; const { locationId, locationName, locationRadius } = props.route.params;
......
...@@ -8,6 +8,15 @@ import { connect } from "react-redux"; ...@@ -8,6 +8,15 @@ import { connect } from "react-redux";
import { FAB } from "react-native-paper"; import { FAB } from "react-native-paper";
import CustomActivityIndicator from "../../components/CustomActivityIndicator"; 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 _HomeScreen = (props) => {
const { userReducer, updateLocations } = props; const { userReducer, updateLocations } = props;
......
...@@ -24,6 +24,14 @@ import { ...@@ -24,6 +24,14 @@ import {
} from "../../constants/inputRequirements"; } from "../../constants/inputRequirements";
import { toast500, toastError, toastSuccess } from "../../constants/toasts"; 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 _RegisterLocationScreen = (props) => {
const { longitude, latitude } = props.route.params; const { longitude, latitude } = props.route.params;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment