From 059528614f693a56da7d8ee644376c241cf172a2 Mon Sep 17 00:00:00 2001 From: Annelisebx <50610153+Annelisebx@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:29:54 -0800 Subject: [PATCH] Two user cards display for each userRole type. Edit icon visible. non-functioning. --- .../belindas_closet/data/Datasource.kt | 21 +++++++++++++++++++ .../com/example/belindas_closet/model/User.kt | 4 ++-- .../belindas_closet/screen/EditUserRole.kt | 20 ++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/belindas_closet/data/Datasource.kt b/app/src/main/java/com/example/belindas_closet/data/Datasource.kt index 31b8f3d5..22b505a2 100644 --- a/app/src/main/java/com/example/belindas_closet/data/Datasource.kt +++ b/app/src/main/java/com/example/belindas_closet/data/Datasource.kt @@ -200,6 +200,9 @@ class Datasource { ) ) + } + init { + // Adding Users to UserList userList.add( User( @@ -210,6 +213,24 @@ class Datasource { userId = "1" ) ) + userList.add( + User( + userFirstName = "Alex", + userLastName = "Brown", + userEmail = "AlexB@gmail.com", + UserRole.STANDARD, + userId = "2" + ) + ) + userList.add( + User( + userFirstName = "Jason", + userLastName = "Ni", + userEmail = "JNi@gmail.com", + UserRole.ADMIN, + userId = "3" + ) + ) } fun loadProducts(): List { diff --git a/app/src/main/java/com/example/belindas_closet/model/User.kt b/app/src/main/java/com/example/belindas_closet/model/User.kt index cd20f3e3..ffec501f 100644 --- a/app/src/main/java/com/example/belindas_closet/model/User.kt +++ b/app/src/main/java/com/example/belindas_closet/model/User.kt @@ -4,8 +4,8 @@ import android.view.View import com.example.belindas_closet.R // saving template of product variables in case of editing user variables similarly -enum class UserRole { - ADMIN, STANDARD +enum class UserRole(val userType: String) { + ADMIN("Admin"), STANDARD("Standard") } // //// Shoes sizes diff --git a/app/src/main/java/com/example/belindas_closet/screen/EditUserRole.kt b/app/src/main/java/com/example/belindas_closet/screen/EditUserRole.kt index 39a8b5c3..2e287579 100644 --- a/app/src/main/java/com/example/belindas_closet/screen/EditUserRole.kt +++ b/app/src/main/java/com/example/belindas_closet/screen/EditUserRole.kt @@ -105,6 +105,26 @@ fun UserCard(userRole: UserRole, navController: NavController) { modifier = Modifier .wrapContentSize() ) + Text( + text = User.userLastName, + style = TextStyle( + fontSize = 15.sp, + fontWeight = FontWeight.Bold, + fontFamily = FontFamily.Default, + ), + modifier = Modifier + .wrapContentSize() + ) + Text( + text = userRole.userType, + style = TextStyle( + fontSize = 15.sp, + fontWeight = FontWeight.Bold, + fontFamily = FontFamily.Default, + ), + modifier = Modifier + .wrapContentSize() + ) Icon(imageVector = Icons.Default.Edit, contentDescription = "Edit") } }