|
|
|
@ -157,7 +157,7 @@ fun TitlePage(titleResId : Int, size : Int, color : Color){
|
|
|
|
|
fun ConnexionButtonLogin(userStub : List<User>, id : String, passwd : String, titleResId : Int, size : Int, colorButton : Color, colorText : Color, navController: NavController){
|
|
|
|
|
val title = stringResource(id = titleResId)
|
|
|
|
|
Button(
|
|
|
|
|
onClick = { ValidLogin(id, passwd, userStub, navController) },
|
|
|
|
|
onClick = { validLogin(id, passwd, userStub, navController) },
|
|
|
|
|
colors = ButtonDefaults.buttonColors(containerColor = colorButton),
|
|
|
|
|
modifier = Modifier
|
|
|
|
|
.fillMaxWidth(),
|
|
|
|
@ -166,14 +166,17 @@ fun ConnexionButtonLogin(userStub : List<User>, id : String, passwd : String, ti
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun ValidLogin(identifiant : String, passwd : String, users : List<User>, navController: NavController){
|
|
|
|
|
|
|
|
|
|
fun validLogin(identifiant : String, passwd : String, users : List<User>, navController: NavController){
|
|
|
|
|
users.forEach { user ->
|
|
|
|
|
if (user.username == identifiant && user.password == passwd){
|
|
|
|
|
navController.navigate("profile")
|
|
|
|
|
//navController.navigate(ProfilPage(navController))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
|
fun CreateAccountButton(titleResId : Int, size : Int, color : Color, navController: NavController){
|
|
|
|
|
val title = stringResource(id = titleResId)
|
|
|
|
|