feat: Add block/unblock functionality and profile menu in OtherProfileScreen
This commit is contained in:
@@ -770,6 +770,35 @@ fun ProfilePhotoMenu(
|
||||
}
|
||||
}
|
||||
|
||||
/** Other user profile menu with block option */
|
||||
@Composable
|
||||
fun OtherProfileMenu(
|
||||
expanded: Boolean,
|
||||
onDismiss: () -> Unit,
|
||||
isDarkTheme: Boolean,
|
||||
isBlocked: Boolean,
|
||||
onBlockClick: () -> Unit
|
||||
) {
|
||||
DropdownMenu(
|
||||
expanded = expanded,
|
||||
onDismissRequest = onDismiss,
|
||||
modifier = Modifier.width(220.dp),
|
||||
properties = PopupProperties(
|
||||
focusable = true,
|
||||
dismissOnBackPress = true,
|
||||
dismissOnClickOutside = true
|
||||
)
|
||||
) {
|
||||
ProfilePhotoMenuItem(
|
||||
icon = if (isBlocked) Icons.Default.CheckCircle else Icons.Default.Block,
|
||||
text = if (isBlocked) "Unblock User" else "Block User",
|
||||
onClick = onBlockClick,
|
||||
tintColor = if (isBlocked) Color(0xFF4CAF50) else Color(0xFFFF3B30),
|
||||
textColor = if (isBlocked) Color(0xFF4CAF50) else Color(0xFFFF3B30)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ProfilePhotoMenuItem(
|
||||
icon: ImageVector,
|
||||
|
||||
Reference in New Issue
Block a user