Немного лишнее убрал

This commit is contained in:
Кашин Максим 2023-11-22 22:54:06 +04:00
parent eb3bc2ea3d
commit bce45a28f0

View File

@ -31,7 +31,6 @@ import kotlinx.coroutines.launch
@Composable @Composable
fun ProfileForm(item: User, userDao: UserDao, navHostController: NavHostController) { fun ProfileForm(item: User, userDao: UserDao, navHostController: NavHostController) {
val isFormVisible = remember { mutableStateOf(false) }
var email by remember { mutableStateOf(item.email) } var email by remember { mutableStateOf(item.email) }
var name by remember { mutableStateOf(item.name) } var name by remember { mutableStateOf(item.name) }
var password by remember { mutableStateOf(item.password) } var password by remember { mutableStateOf(item.password) }
@ -39,7 +38,6 @@ fun ProfileForm(item: User, userDao: UserDao, navHostController: NavHostControll
Column( Column(
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
) { ) {
// Поле ввода для бренда
TextField( TextField(
value = email, value = email,
onValueChange = { email = it }, onValueChange = { email = it },
@ -50,7 +48,6 @@ fun ProfileForm(item: User, userDao: UserDao, navHostController: NavHostControll
colors = TextFieldDefaults.textFieldColors(backgroundColor = Color.White) colors = TextFieldDefaults.textFieldColors(backgroundColor = Color.White)
) )
// Поле ввода для модели
TextField( TextField(
value = name, value = name,
onValueChange = { name = it }, onValueChange = { name = it },
@ -61,7 +58,6 @@ fun ProfileForm(item: User, userDao: UserDao, navHostController: NavHostControll
colors = TextFieldDefaults.textFieldColors(backgroundColor = Color.White) colors = TextFieldDefaults.textFieldColors(backgroundColor = Color.White)
) )
// Поле ввода для цвета
TextField( TextField(
value = password, value = password,
onValueChange = { password = it }, onValueChange = { password = it },
@ -86,7 +82,6 @@ fun ProfileForm(item: User, userDao: UserDao, navHostController: NavHostControll
userDao.updateUser(newUser) userDao.updateUser(newUser)
} }
isFormVisible.value = false
navHostController.navigate("ListProduct") navHostController.navigate("ListProduct")
}, },
shape = RoundedCornerShape(15.dp) shape = RoundedCornerShape(15.dp)
@ -104,7 +99,6 @@ fun ProfileForm(item: User, userDao: UserDao, navHostController: NavHostControll
.fillMaxWidth() .fillMaxWidth()
.padding(9.dp), .padding(9.dp),
onClick = { onClick = {
isFormVisible.value = false
navHostController.navigate("ListProduct") navHostController.navigate("ListProduct")
}, },
shape = RoundedCornerShape(15.dp) shape = RoundedCornerShape(15.dp)