Норм путь к отчету
This commit is contained in:
parent
34f379b65d
commit
99f294da5d
@ -282,20 +282,6 @@ fun UserProfile(
|
|||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Center
|
||||||
) {
|
) {
|
||||||
Button(
|
|
||||||
onClick = {
|
|
||||||
coroutineScope.launch {
|
|
||||||
//createPdfFile(context = context, fileName = "отчет.pdf")
|
|
||||||
navController?.navigate(Screen.Report.route)
|
|
||||||
Log.d("context", "${context}")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(8.dp)
|
|
||||||
) {
|
|
||||||
Text("Сформировать")
|
|
||||||
}
|
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
"Темная тема",
|
"Темная тема",
|
||||||
@ -383,6 +369,7 @@ fun LoginScreen(navController: NavController?) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun LoginScreenProfile(currentUserViewModel: CurrentUserViewModel = viewModel(factory = AppViewModelProvider.Factory), navController: NavController?) {
|
fun LoginScreenProfile(currentUserViewModel: CurrentUserViewModel = viewModel(factory = AppViewModelProvider.Factory), navController: NavController?) {
|
||||||
var getUser by remember { mutableStateOf(currentUserViewModel.user) }
|
var getUser by remember { mutableStateOf(currentUserViewModel.user) }
|
||||||
|
val coroutineScope = rememberCoroutineScope()
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
@ -405,8 +392,21 @@ fun LoginScreenProfile(currentUserViewModel: CurrentUserViewModel = viewModel(fa
|
|||||||
text = "Вы авторизованы под аккаунтом: ${getUser?.login}",
|
text = "Вы авторизованы под аккаунтом: ${getUser?.login}",
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
if(getUser?.role == "admin") {
|
||||||
|
Button(
|
||||||
|
onClick = {
|
||||||
|
coroutineScope.launch {
|
||||||
|
navController?.navigate(Screen.Report.route)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(8.dp)
|
||||||
|
) {
|
||||||
|
Text("Сформировать отчет")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
|
Loading…
Reference in New Issue
Block a user