|
|
@ -68,7 +68,7 @@ fun LoginPage(navControllerSignUp: () -> Unit, navControllerProfil: (Int) -> Uni
|
|
|
|
|
|
|
|
|
|
|
|
TitlePageComponent(R.string.titleLogin, MaterialTheme.colorScheme.primary)
|
|
|
|
TitlePageComponent(R.string.titleLogin, MaterialTheme.colorScheme.primary)
|
|
|
|
SpaceHeightComponent(20)
|
|
|
|
SpaceHeightComponent(20)
|
|
|
|
ConnexionButtonLogin(users,IdentifiantTextField(R.string.IdentifiantLogin, authState.username){
|
|
|
|
ConnexionButtonLogin(authUserVM,IdentifiantTextField(R.string.IdentifiantLogin, authState.username){
|
|
|
|
authUserVM.setUsername(it)
|
|
|
|
authUserVM.setUsername(it)
|
|
|
|
}, PassWdTextField(R.string.PasswdLogin, authState.password){
|
|
|
|
}, PassWdTextField(R.string.PasswdLogin, authState.password){
|
|
|
|
authUserVM.setPassword(it)
|
|
|
|
authUserVM.setPassword(it)
|
|
|
@ -128,11 +128,11 @@ fun PassWdTextField(textpasswdResId : Int, password : String, onValueChange: (St
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun ConnexionButtonLogin(users : List<User>, username : String, passwd : String, titleResId : Int, size : Int, navController: (Int) -> Unit){
|
|
|
|
fun ConnexionButtonLogin(authUserVM : AuthUserViewModel, username : String, passwd : String, titleResId : Int, size : Int, navController: (Int) -> Unit){
|
|
|
|
val title = stringResource(id = titleResId)
|
|
|
|
val title = stringResource(id = titleResId)
|
|
|
|
var showError by remember { mutableStateOf(false) }
|
|
|
|
var showError by remember { mutableStateOf(false) }
|
|
|
|
Button(
|
|
|
|
Button(
|
|
|
|
onClick = { showError = !validLogin(username, passwd, users, navController)
|
|
|
|
onClick = { showError = !authUserVM.validLogin(username, passwd, navController)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
colors = ButtonDefaults.buttonColors(containerColor = MaterialTheme.colorScheme.background),
|
|
|
|
colors = ButtonDefaults.buttonColors(containerColor = MaterialTheme.colorScheme.background),
|
|
|
|
modifier = Modifier
|
|
|
|
modifier = Modifier
|
|
|
|