Skip to content

Instantly share code, notes, and snippets.

@saqib-github-commits
Created August 20, 2023 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saqib-github-commits/707540ec55b4afeff1035056fd01e524 to your computer and use it in GitHub Desktop.
Save saqib-github-commits/707540ec55b4afeff1035056fd01e524 to your computer and use it in GitHub Desktop.
@Composable
private fun DrawerContent(
menus: Array<DrawerMenu>,
onMenuClick: (String) -> Unit
) {
Column(
modifier = Modifier.fillMaxSize()
) {
Box(
modifier = Modifier
.fillMaxWidth()
.height(200.dp),
contentAlignment = Alignment.Center
) {
Image(
modifier = Modifier.size(150.dp),
imageVector = Icons.Filled.AccountCircle,
contentScale = ContentScale.Crop,
contentDescription = null
)
}
Spacer(modifier = Modifier.height(12.dp))
menus.forEach {
NavigationDrawerItem(
label = { Text(text = it.title) },
icon = { Icon(imageVector = it.icon, contentDescription = null) },
selected = false,
onClick = {
onMenuClick(it.route)
}
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment