Skip to content

Commit

Permalink
feat: enhance login UI responsiveness and feedback
Browse files Browse the repository at this point in the history
- Add import for `MGCircularProgressIndicator` in the login feature
- Simplify login submission logic by removing print statement
- Update submit button behavior to show progress indicator when loading

Signed-off-by: jnelle <[email protected]>
  • Loading branch information
jnelle committed Jun 24, 2024
1 parent 7c6e85a commit 3513fb1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions composeApp/src/commonMain/kotlin/features/login/Login.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.screen.Screen
import com.mgtvapi.api.repository.MGTVApiRepository
import common.components.MGCircularProgressIndicator
import kotlinx.coroutines.launch
import massengeschmacktv.composeapp.generated.resources.Res
import massengeschmacktv.composeapp.generated.resources.email
Expand Down Expand Up @@ -88,9 +89,7 @@ class LoginScreen() : Screen {
onSubmit = {
scope.launch {
loading = true
val result =
repo.login(email = email, password = password)
println(result)
loading = false
}
},
Expand Down Expand Up @@ -154,7 +153,11 @@ fun LoginContent(
modifier = Modifier.fillMaxWidth(),
enabled = isSubmitEnabled,
) {
Text(text = stringResource(resource = Res.string.login_submit))
if (!loading){
Text(text = stringResource(resource = Res.string.login_submit))
} else {
MGCircularProgressIndicator()
}
}
}
}
Expand Down

0 comments on commit 3513fb1

Please sign in to comment.