Merge branch 'develop' into feature/fga/presenter_tests
This commit is contained in:
commit
3a6be5f745
300 changed files with 772 additions and 209 deletions
|
|
@ -20,7 +20,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.res.stringResource
|
||||
import io.element.android.x.core.uri.isValidUrl
|
||||
import io.element.android.x.features.login.root.LoginFormState
|
||||
import io.element.android.x.element.resources.R as ElementR
|
||||
import io.element.android.x.ui.strings.R as StringR
|
||||
|
||||
@Composable
|
||||
fun loginError(
|
||||
|
|
@ -30,7 +30,7 @@ fun loginError(
|
|||
return when {
|
||||
data.login.isEmpty() -> "Please enter a login"
|
||||
data.password.isEmpty() -> "Please enter a password"
|
||||
throwable != null -> stringResource(id = ElementR.string.auth_invalid_login_param)
|
||||
throwable != null -> stringResource(id = StringR.string.auth_invalid_login_param)
|
||||
else -> "No error provided"
|
||||
}
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ fun changeServerError(
|
|||
): String {
|
||||
return when {
|
||||
data.isEmpty() -> "Please enter a server URL"
|
||||
!data.isValidUrl() -> stringResource(id = ElementR.string.login_error_invalid_home_server)
|
||||
!data.isValidUrl() -> stringResource(id = StringR.string.login_error_invalid_home_server)
|
||||
throwable != null -> "That server doesn’t seem right. Please check the address."
|
||||
else -> "No error provided"
|
||||
}
|
||||
|
|
@ -48,6 +48,7 @@ import androidx.compose.runtime.remember
|
|||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
|
|
@ -61,6 +62,7 @@ import io.element.android.x.core.compose.textFieldState
|
|||
import io.element.android.x.designsystem.ElementXTheme
|
||||
import io.element.android.x.features.login.error.loginError
|
||||
import io.element.android.x.matrix.core.SessionId
|
||||
import io.element.android.x.ui.strings.R as StringR
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
|
|
@ -95,7 +97,7 @@ fun LoginRootScreen(
|
|||
val isError = state.loggedInState is LoggedInState.ErrorLoggingIn
|
||||
// Title
|
||||
Text(
|
||||
text = "Welcome back",
|
||||
text = stringResource(id = StringR.string.ftue_auth_welcome_back_title),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 48.dp),
|
||||
|
|
@ -138,7 +140,7 @@ fun LoginRootScreen(
|
|||
.fillMaxWidth()
|
||||
.padding(top = 60.dp),
|
||||
label = {
|
||||
Text(text = "Email or username")
|
||||
Text(text = stringResource(id = StringR.string.login_signin_username_hint))
|
||||
},
|
||||
onValueChange = {
|
||||
loginFieldState = it
|
||||
Loading…
Add table
Add a link
Reference in a new issue