feat: Add block/unblock functionality and profile menu in OtherProfileScreen

This commit is contained in:
2026-01-22 18:51:14 +05:00
parent d0f6de1772
commit 538181cf39
2 changed files with 132 additions and 106 deletions

View File

@@ -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,