|
@@ -16,6 +16,7 @@ import androidx.compose.ui.platform.LocalContext
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
import com.framework.mvvm.model.db.entity.ProjectEntity
|
|
|
+import com.framework.mvvm.model.db.entity.UserEntity
|
|
|
import com.framework.mvvm.mv.AdmViewModel
|
|
|
import com.sybotan.android.demo.activities.PocActivity
|
|
|
import org.kodein.di.compose.localDI
|
|
@@ -28,6 +29,7 @@ fun ProjectScreen() {
|
|
|
val context = LocalContext.current
|
|
|
|
|
|
var projects by remember { mutableStateOf<List<ProjectEntity>>(emptyList()) }
|
|
|
+ var user by remember { mutableStateOf<UserEntity?>(null) }
|
|
|
|
|
|
Column(modifier = Modifier.fillMaxWidth()) {
|
|
|
Row(
|
|
@@ -45,6 +47,7 @@ fun ProjectScreen() {
|
|
|
|
|
|
LaunchedEffect(key1 = "project") {
|
|
|
projects = vm.getProjects()
|
|
|
+ user = vm.getCurrentUser()
|
|
|
}
|
|
|
|
|
|
LazyColumn {
|
|
@@ -52,12 +55,13 @@ fun ProjectScreen() {
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
- .height(56.dp)
|
|
|
+ .height(64.dp)
|
|
|
+ .padding(top = 8.dp, bottom = 8.dp)
|
|
|
.background(Color.Gray)
|
|
|
.clickable {
|
|
|
val intent = Intent(context, PocActivity::class.java)
|
|
|
val bundle = Bundle()
|
|
|
- bundle.putString("userId", project.userId)
|
|
|
+ bundle.putString("userId", user?.username ?: "")
|
|
|
bundle.putString("groupCode", project.groupCode)
|
|
|
bundle.putString("projectId", project.projectId)
|
|
|
intent.putExtra("project", bundle)
|