Skip to content

Commit

Permalink
Fix start padding of org unit item (#248)
Browse files Browse the repository at this point in the history
Co-authored-by: Siddharth Agarwal <[email protected]>
  • Loading branch information
siddh1004 and Siddharth Agarwal authored May 31, 2024
1 parent 96c45c8 commit cda4041
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ private fun OrgTreeList(
items(orgTreeItems) { item ->
OrgUnitSelectorItem(
orgTreeItem = item,
higherLevel = orgTreeItems.minBy { it.level }.level,
searchQuery = searchQuery,
onItemClick = onItemClick,
onItemSelected = onItemSelected,
Expand All @@ -207,6 +208,7 @@ private fun OrgTreeList(
@Composable
fun OrgUnitSelectorItem(
orgTreeItem: OrgTreeItem,
higherLevel: Int,
searchQuery: String,
modifier: Modifier = Modifier,
onItemClick: (uid: String) -> Unit,
Expand All @@ -226,7 +228,7 @@ fun OrgUnitSelectorItem(
) {
onItemClick(orgTreeItem.uid)
}
.padding(start = ((orgTreeItem.level * 2) * 16).dp),
.padding(start = ((orgTreeItem.level - higherLevel) * 16).dp),
verticalAlignment = Alignment.CenterVertically,
) {
val icon = orgTreeItemIcon(orgTreeItem)
Expand Down

0 comments on commit cda4041

Please sign in to comment.