feat: Add Clear Chat History option to OtherProfileMenu
This commit is contained in:
@@ -777,8 +777,11 @@ fun OtherProfileMenu(
|
||||
onDismiss: () -> Unit,
|
||||
isDarkTheme: Boolean,
|
||||
isBlocked: Boolean,
|
||||
onBlockClick: () -> Unit
|
||||
onBlockClick: () -> Unit,
|
||||
onClearChatClick: () -> Unit
|
||||
) {
|
||||
val dividerColor = if (isDarkTheme) Color.White.copy(alpha = 0.1f) else Color.Black.copy(alpha = 0.08f)
|
||||
|
||||
DropdownMenu(
|
||||
expanded = expanded,
|
||||
onDismissRequest = onDismiss,
|
||||
@@ -796,6 +799,22 @@ fun OtherProfileMenu(
|
||||
tintColor = if (isBlocked) Color(0xFF4CAF50) else Color(0xFFFF3B30),
|
||||
textColor = if (isBlocked) Color(0xFF4CAF50) else Color(0xFFFF3B30)
|
||||
)
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 4.dp)
|
||||
.height(0.5.dp)
|
||||
.background(dividerColor)
|
||||
)
|
||||
|
||||
ProfilePhotoMenuItem(
|
||||
icon = Icons.Default.Delete,
|
||||
text = "Clear Chat History",
|
||||
onClick = onClearChatClick,
|
||||
tintColor = Color(0xFFFF3B30),
|
||||
textColor = Color(0xFFFF3B30)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -270,6 +270,10 @@ private fun CollapsingOtherProfileHeader(
|
||||
onBlockClick = {
|
||||
onAvatarMenuChange(false)
|
||||
onBlockToggle()
|
||||
},
|
||||
onClearChatClick = {
|
||||
onAvatarMenuChange(false)
|
||||
// TODO: Реализовать очистку истории чата
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user