|
|
@ -49,8 +49,6 @@ import androidx.lifecycle.viewmodel.compose.viewModel
|
|
|
|
import coil.compose.AsyncImage
|
|
|
|
import coil.compose.AsyncImage
|
|
|
|
import com.example.what_the_fantasy.Logs.LogsUsers
|
|
|
|
import com.example.what_the_fantasy.Logs.LogsUsers
|
|
|
|
import com.example.what_the_fantasy.R
|
|
|
|
import com.example.what_the_fantasy.R
|
|
|
|
import com.example.what_the_fantasy.data.model.SrcLanguage
|
|
|
|
|
|
|
|
import com.example.what_the_fantasy.data.model.User
|
|
|
|
|
|
|
|
import com.example.what_the_fantasy.data.services.IServices
|
|
|
|
import com.example.what_the_fantasy.data.services.IServices
|
|
|
|
import com.example.what_the_fantasy.ui.components.ErrorMessageProfileComponent
|
|
|
|
import com.example.what_the_fantasy.ui.components.ErrorMessageProfileComponent
|
|
|
|
import com.example.what_the_fantasy.ui.components.NavBar
|
|
|
|
import com.example.what_the_fantasy.ui.components.NavBar
|
|
|
@ -58,8 +56,6 @@ import com.example.what_the_fantasy.ui.components.SpaceHeightComponent
|
|
|
|
import com.example.what_the_fantasy.ui.components.TitlePageComponent
|
|
|
|
import com.example.what_the_fantasy.ui.components.TitlePageComponent
|
|
|
|
import com.example.what_the_fantasy.ui.components.VisibleIconPasswordComponent
|
|
|
|
import com.example.what_the_fantasy.ui.components.VisibleIconPasswordComponent
|
|
|
|
import com.example.what_the_fantasy.ui.states.CurrentUserState
|
|
|
|
import com.example.what_the_fantasy.ui.states.CurrentUserState
|
|
|
|
import com.example.what_the_fantasy.ui.theme.gradienBox
|
|
|
|
|
|
|
|
import com.example.what_the_fantasy.ui.viewModels.AuthUserViewModel
|
|
|
|
|
|
|
|
import com.example.what_the_fantasy.ui.viewModels.CurrentUserViewModel
|
|
|
|
import com.example.what_the_fantasy.ui.viewModels.CurrentUserViewModel
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
@ -71,7 +67,6 @@ fun ProfilPage(index: Int,
|
|
|
|
navSubmitQuote: () -> Unit,
|
|
|
|
navSubmitQuote: () -> Unit,
|
|
|
|
services: IServices
|
|
|
|
services: IServices
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
val user = services.getUserById(index) ?: return
|
|
|
|
|
|
|
|
val currentUserVM : CurrentUserViewModel = viewModel()
|
|
|
|
val currentUserVM : CurrentUserViewModel = viewModel()
|
|
|
|
val currentUserState by currentUserVM.currentUserState.collectAsState()
|
|
|
|
val currentUserState by currentUserVM.currentUserState.collectAsState()
|
|
|
|
|
|
|
|
|
|
|
@ -104,7 +99,7 @@ fun ProfilPage(index: Int,
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
|
|
|
|
|
|
|
|
// Image de profil
|
|
|
|
// Image de profil
|
|
|
|
ImageProfil(user.imgUrl, 120)
|
|
|
|
ImageProfil(currentUserState.imagePath, 120)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
SpaceHeightComponent(16)
|
|
|
|
|
|
|
|
|
|
|
|
EditUsername(currentUserState.username, index, currentUserVM)// Édition du Username
|
|
|
|
EditUsername(currentUserState.username, index, currentUserVM)// Édition du Username
|
|
|
@ -476,12 +471,12 @@ fun ButtonLanguage(textResId : Int, size :Int, colorButton : Color, currentUserV
|
|
|
|
|
|
|
|
|
|
|
|
Button(
|
|
|
|
Button(
|
|
|
|
onClick = {
|
|
|
|
onClick = {
|
|
|
|
currentUserVM.editLangue(10) // a mettre a la place : currentUserState.id
|
|
|
|
currentUserVM.editLangue(currentUserState.id)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
colors = ButtonDefaults.buttonColors(containerColor = colorButton),
|
|
|
|
colors = ButtonDefaults.buttonColors(containerColor = colorButton),
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Text("${text} (${currentUserState.langue})", fontSize = size.sp, color = MaterialTheme.colorScheme.primary)
|
|
|
|
Text("${text} (${currentUserState.langage})", fontSize = size.sp, color = MaterialTheme.colorScheme.primary)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|