From 5225492bbbed0461cb4db7376010aa89d5bbc4a0 Mon Sep 17 00:00:00 2001 From: Andrea Magnussen <andrea@magnussen.net> Date: Tue, 15 Jun 2021 12:53:48 +0200 Subject: [PATCH] Added documentation to authentication screens --- screens/SignInScreen.js | 7 +++++++ screens/SignUpScreen.js | 8 ++++++++ screens/VerifyPasswordScreen.js | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/screens/SignInScreen.js b/screens/SignInScreen.js index c5f538e..18a3abd 100644 --- a/screens/SignInScreen.js +++ b/screens/SignInScreen.js @@ -19,6 +19,13 @@ import { Button } from "react-native-paper"; import CustomActivityIndicator from "../components/CustomActivityIndicator"; import { NAME_MAX_LENGTH } from "../constants/inputRequirements"; +/** + * This component renders the screen where the user can sign in. The actual sign in process is done in a user action through redux. + * + * @param {*} props - used for redux and navigation. + * + * @returns the component. + */ const _SignInScreen = (props) => { const { onUserLogin } = props; diff --git a/screens/SignUpScreen.js b/screens/SignUpScreen.js index be2a42e..03b266a 100644 --- a/screens/SignUpScreen.js +++ b/screens/SignUpScreen.js @@ -24,6 +24,14 @@ import APIKit from "../APIkit"; import CustomActivityIndicator from "../components/CustomActivityIndicator"; import { toast500, toastError, toastSuccess } from "../constants/toasts"; +/** + * This component renders the screen where the user can create a new user. They will be navigated to the sign in screen when the user is + * created, and has to wait for an administrator to grant them access to use the application. + * + * @param {*} navigation - extracted from props, used for navigation + * + * @returns the component. + */ const SignUpScreen = ({ navigation }) => { const [name, setName] = useState(""); const [email, setEmail] = useState(""); diff --git a/screens/VerifyPasswordScreen.js b/screens/VerifyPasswordScreen.js index 0d7a2e8..06e1cd0 100644 --- a/screens/VerifyPasswordScreen.js +++ b/screens/VerifyPasswordScreen.js @@ -12,6 +12,15 @@ import APIKit from "../APIkit"; import CustomActivityIndicator from "../components/CustomActivityIndicator"; import { toast500, toastError } from "../constants/toasts"; +/** + * This component renders the screen where the user needs to re-authenticate to get access to a critical feature. + * + * @param {*} route - extracted from props, used to get data from the previous screen. In this case, to know which screen should be + * navigated to next. + * @param {*} navigation - extracted from props, used for navigation. + * + * @returns the component. + */ const VerifyPasswordScreen = ({ route, navigation }) => { const { nextNavigation } = route.params; -- GitLab