diff --git a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt index 373df5e6a..d9f380eca 100644 --- a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt +++ b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt @@ -50,7 +50,7 @@ fun AuthLinksBox( text = stringResource(MoviesStrings.auth_terms_of_use), modifier = Modifier .padding(vertical = 16.dp) - .clickableWithoutRipple { navigateToTermsOfUseUrl() }, + .clickableWithoutRipple(navigateToTermsOfUseUrl), style = MaterialTheme.typography.bodyMedium.copy(MaterialTheme.colorScheme.onPrimaryContainer) ) @@ -66,7 +66,7 @@ fun AuthLinksBox( text = stringResource(MoviesStrings.auth_privacy_policy), modifier = Modifier .padding(vertical = 16.dp) - .clickableWithoutRipple { navigateToPrivacyPolicyUrl() }, + .clickableWithoutRipple(navigateToPrivacyPolicyUrl), style = MaterialTheme.typography.bodyMedium.copy(MaterialTheme.colorScheme.onPrimaryContainer) ) } diff --git a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt index ebe5b9640..d30c21cbd 100644 --- a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt +++ b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt @@ -117,11 +117,17 @@ internal fun AuthScreenContent( OutlinedTextField( value = username.value, - onValueChange = { value -> username = Username(value) }, + onValueChange = { value -> + username = Username(value.filterNot(Char::isWhitespace)) + }, modifier = Modifier .fillMaxWidth() .padding(start = 16.dp, top = 8.dp, end = 16.dp), - label = { Text(text = stringResource(MoviesStrings.auth_label_username)) }, + label = { + Text( + text = stringResource(MoviesStrings.auth_label_username) + ) + }, isError = error != null, keyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Text, @@ -135,11 +141,15 @@ internal fun AuthScreenContent( OutlinedTextField( value = password.value, - onValueChange = { value -> password = Password(value) }, + onValueChange = { value -> password = Password(value.filterNot(Char::isWhitespace)) }, modifier = Modifier .fillMaxWidth() .padding(start = 16.dp, top = 8.dp, end = 16.dp), - label = { Text(text = stringResource(MoviesStrings.auth_label_password)) }, + label = { + Text( + text = stringResource(MoviesStrings.auth_label_password) + ) + }, trailingIcon = { AnimatedVisibility( visible = password.isNotEmpty, @@ -154,7 +164,10 @@ internal fun AuthScreenContent( }, supportingText = { if (error != null) { - Text(text = error.text, color = MaterialTheme.colorScheme.error) + Text( + text = error.text, + color = MaterialTheme.colorScheme.error + ) } }, isError = error != null, @@ -177,7 +190,7 @@ internal fun AuthScreenContent( verticalAlignment = Alignment.CenterVertically ) { TextButton( - onClick = { navigateToTmdbRegisterUrl() } + onClick = navigateToTmdbRegisterUrl ) { Text( text = stringResource(MoviesStrings.auth_sign_up) @@ -190,7 +203,7 @@ internal fun AuthScreenContent( exit = fadeOut() ) { TextButton( - onClick = { navigateToTmdbResetPasswordUrl() } + onClick = navigateToTmdbResetPasswordUrl ) { Text( text = stringResource(MoviesStrings.auth_reset_password)