Skip to content

Commit

Permalink
Two user cards display for each userRole type. Edit icon visible. non…
Browse files Browse the repository at this point in the history
…-functioning.
  • Loading branch information
Annelisebx committed Dec 6, 2023
1 parent cae0619 commit 0595286
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
21 changes: 21 additions & 0 deletions app/src/main/java/com/example/belindas_closet/data/Datasource.kt
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ class Datasource {
)
)

}
init {

// Adding Users to UserList
userList.add(
User(
Expand All @@ -210,6 +213,24 @@ class Datasource {
userId = "1"
)
)
userList.add(
User(
userFirstName = "Alex",
userLastName = "Brown",
userEmail = "[email protected]",
UserRole.STANDARD,
userId = "2"
)
)
userList.add(
User(
userFirstName = "Jason",
userLastName = "Ni",
userEmail = "[email protected]",
UserRole.ADMIN,
userId = "3"
)
)
}

fun loadProducts(): List<Product> {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/example/belindas_closet/model/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down

0 comments on commit 0595286

Please sign in to comment.