diff --git a/screens/profile/ChangeEmailScreen.js b/screens/profile/ChangeEmailScreen.js index d39354a328a08c29bcd199f89b14ea6852420dd8..1ab90230a31083012f780467e50d32b8334c89d0 100644 --- a/screens/profile/ChangeEmailScreen.js +++ b/screens/profile/ChangeEmailScreen.js @@ -24,6 +24,14 @@ import { toast500 } from "../../constants/toasts"; +/** + * This component renders the screen where a user can change their email. To do this, the user has to re-authenicate due to it being a critical + * feature. + * + * @param {*} props - used for redux and navigation. + * + * @returns the component. + */ const _ChangeEmailScreen = (props) => { const { userReducer, onEditEmail } = props; const [email, setEmail] = useState(""); @@ -32,7 +40,7 @@ const _ChangeEmailScreen = (props) => { const { user } = userReducer; - // for navigation to work on android + // To make the back-button on android behave correctly and not go to the VerifyPasswordScreen useEffect(() => { props.navigation.addListener('beforeRemove', (e) => { e.preventDefault(); diff --git a/screens/profile/ChangeNameScreen.js b/screens/profile/ChangeNameScreen.js index 5d34dde4b2792dbfb4910a3d7abdefc207fa414c..d94be6f5b00d76b54b1a71658a4382685d8408ea 100644 --- a/screens/profile/ChangeNameScreen.js +++ b/screens/profile/ChangeNameScreen.js @@ -21,6 +21,14 @@ import { toast500 } from "../../constants/toasts"; +/** + * This component renders the screen where a user can change their name in the system. The name is simply for aesthetic reasons, and is not used for + * anything other than being shown to the user. Can be used in future releases. + * + * @param {*} props - used for redux and navigation. + * + * @returns the component. + */ const _ChangeNameScreen = (props) => { const { userReducer, onEditName } = props; diff --git a/screens/profile/ChangePasswordScreen.js b/screens/profile/ChangePasswordScreen.js index bb47aeb78e2956c7ff9c236302d63437e14ab8a7..d82389b676de8ab0dfe626e281539518b5fd733f 100644 --- a/screens/profile/ChangePasswordScreen.js +++ b/screens/profile/ChangePasswordScreen.js @@ -20,6 +20,14 @@ import { toast500 } from "../../constants/toasts"; +/** + * This component renders the screen where a user can change their password. The user needs to re-authenticate to access this + * feature, due to it being critical. + * + * @param {*} navigation - extracted from props and used for navigation. + * + * @returns the component. + */ const ChangePasswordScreen = ({ navigation }) => { const [password, setPassword] = useState(""); const [confirmPassword, setConfirmPassword] = useState(""); diff --git a/screens/profile/DeleteAccountScreen.js b/screens/profile/DeleteAccountScreen.js index f14324ad95b33dfdaff209244aa102af11f09169..2f1441689780fd126847f5f8f62a7d05d3e4aba5 100644 --- a/screens/profile/DeleteAccountScreen.js +++ b/screens/profile/DeleteAccountScreen.js @@ -12,6 +12,14 @@ import { toast500 } from "../../constants/toasts"; +/** + * This component renders the screen where the user can delete their account from the system. The user needs to re-authenticate + * to access this feature, due to it being critical. To delete their account, they have to confirm the decision. + * + * @param {*} props - used for redux and navigation. + * + * @returns the component. + */ const _DeleteAccountScreen = (props) => { const { signOutApp } = React.useContext(AuthContext); diff --git a/screens/profile/ProfileScreen.js b/screens/profile/ProfileScreen.js index 1509e976c74fca457e7ac1185732fbfee82cd21c..b67d8b32e93dd9f9e404822b1340cba037fdb441 100644 --- a/screens/profile/ProfileScreen.js +++ b/screens/profile/ProfileScreen.js @@ -7,6 +7,15 @@ import CustomTouchableOpacity from "../../components/CustomTouchableOpacity"; import { AuthContext } from "../../constants/context"; import { onUserSignOut } from "../../redux/actions/UserActions"; +/** + * This component renders the profile screen where the user can access all features regarding data in the system. Some features are + * restricted to role, and some featuers require re-authentication to get access. The user can also log out of the application through + * this screen. + * + * @param {*} props - used for redux and navigation. + * + * @returns the component. + */ const _ProfileScreen = (props) => { const { userReducer, onUserSignOut } = props;