From aa4ac7277eeca94c52597bad61f6920f4cc76f1a Mon Sep 17 00:00:00 2001 From: Puvikaran Santhirasegaram <74664443+Puvikaran2001@users.noreply.github.com> Date: Wed, 22 May 2024 09:46:40 +0200 Subject: [PATCH] Add documentation --- .../schedulingfrontend/pages/LoginPage.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/LoginPage.kt b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/LoginPage.kt index 2944de6e..0e74917f 100644 --- a/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/LoginPage.kt +++ b/frontend/app/src/main/java/dk/scheduling/schedulingfrontend/pages/LoginPage.kt @@ -49,20 +49,20 @@ fun LoginPage( val coroutineScope = rememberCoroutineScope() Title(titleText = "Login") - + // Arranges the fields and the button in vertical sequence. Column( modifier = modifier .fillMaxSize() - .padding(50.dp), + .padding(50.dp), // Adjust column placement. horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, ) { - StandardTextField( + StandardTextField( // Input field for username. label = "Username", value = username, onValueChange = { - username = it + username = it // it holds the value of the text field. if (isLoginFailed) isLoginFailed = false }, isError = isLoginFailed, @@ -70,16 +70,16 @@ fun LoginPage( Spacer(modifier = Modifier.height(20.dp)) - PasswordTextField( + PasswordTextField( // Input field for password. password, onPasswordChange = { - password = it + password = it // it holds the value of the text field. if (isLoginFailed) isLoginFailed = false }, isError = isLoginFailed, ) - if (isLoginFailed) { + if (isLoginFailed) { // Shows an error message if the login fails Spacer(modifier = Modifier.height(20.dp)) Text( text = "Wrong username or password", @@ -91,7 +91,7 @@ fun LoginPage( FilledButton( onClick = { - coroutineScope.launch { + coroutineScope.launch { // Runs asynchronous if (accountRepo.login(username, password)) { navigateOnValidLogin() } else {