Simplify a bit the API.
This commit is contained in:
parent
8a3f33ce1a
commit
e66c793fbe
1 changed files with 11 additions and 11 deletions
|
|
@ -51,15 +51,15 @@ fun RoomListContextMenu(
|
||||||
contextMenu = contextMenu,
|
contextMenu = contextMenu,
|
||||||
onRoomMarkReadClicked = {
|
onRoomMarkReadClicked = {
|
||||||
eventSink(RoomListEvents.HideContextMenu)
|
eventSink(RoomListEvents.HideContextMenu)
|
||||||
eventSink(RoomListEvents.MarkAsRead(it))
|
eventSink(RoomListEvents.MarkAsRead(contextMenu.roomId))
|
||||||
},
|
},
|
||||||
onRoomMarkUnreadClicked = {
|
onRoomMarkUnreadClicked = {
|
||||||
eventSink(RoomListEvents.HideContextMenu)
|
eventSink(RoomListEvents.HideContextMenu)
|
||||||
eventSink(RoomListEvents.MarkAsUnread(it))
|
eventSink(RoomListEvents.MarkAsUnread(contextMenu.roomId))
|
||||||
},
|
},
|
||||||
onRoomSettingsClicked = {
|
onRoomSettingsClicked = {
|
||||||
eventSink(RoomListEvents.HideContextMenu)
|
eventSink(RoomListEvents.HideContextMenu)
|
||||||
onRoomSettingsClicked(it)
|
onRoomSettingsClicked(contextMenu.roomId)
|
||||||
},
|
},
|
||||||
onLeaveRoomClicked = {
|
onLeaveRoomClicked = {
|
||||||
eventSink(RoomListEvents.HideContextMenu)
|
eventSink(RoomListEvents.HideContextMenu)
|
||||||
|
|
@ -72,10 +72,10 @@ fun RoomListContextMenu(
|
||||||
@Composable
|
@Composable
|
||||||
private fun RoomListModalBottomSheetContent(
|
private fun RoomListModalBottomSheetContent(
|
||||||
contextMenu: RoomListState.ContextMenu.Shown,
|
contextMenu: RoomListState.ContextMenu.Shown,
|
||||||
onRoomMarkReadClicked: (roomId: RoomId) -> Unit,
|
onRoomMarkReadClicked: () -> Unit,
|
||||||
onRoomMarkUnreadClicked: (roomId: RoomId) -> Unit,
|
onRoomMarkUnreadClicked: () -> Unit,
|
||||||
onRoomSettingsClicked: (roomId: RoomId) -> Unit,
|
onRoomSettingsClicked: () -> Unit,
|
||||||
onLeaveRoomClicked: (roomId: RoomId) -> Unit,
|
onLeaveRoomClicked: () -> Unit,
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
|
@ -103,9 +103,9 @@ private fun RoomListModalBottomSheetContent(
|
||||||
},
|
},
|
||||||
modifier = Modifier.clickable {
|
modifier = Modifier.clickable {
|
||||||
if (contextMenu.hasNewContent) {
|
if (contextMenu.hasNewContent) {
|
||||||
onRoomMarkReadClicked(contextMenu.roomId)
|
onRoomMarkReadClicked()
|
||||||
} else {
|
} else {
|
||||||
onRoomMarkUnreadClicked(contextMenu.roomId)
|
onRoomMarkUnreadClicked()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* TODO Design
|
/* TODO Design
|
||||||
|
|
@ -125,7 +125,7 @@ private fun RoomListModalBottomSheetContent(
|
||||||
style = MaterialTheme.typography.bodyLarge,
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
modifier = Modifier.clickable { onRoomSettingsClicked(contextMenu.roomId) },
|
modifier = Modifier.clickable { onRoomSettingsClicked() },
|
||||||
leadingContent = ListItemContent.Icon(
|
leadingContent = ListItemContent.Icon(
|
||||||
iconSource = IconSource.Vector(
|
iconSource = IconSource.Vector(
|
||||||
CompoundIcons.Settings,
|
CompoundIcons.Settings,
|
||||||
|
|
@ -145,7 +145,7 @@ private fun RoomListModalBottomSheetContent(
|
||||||
)
|
)
|
||||||
Text(text = leaveText)
|
Text(text = leaveText)
|
||||||
},
|
},
|
||||||
modifier = Modifier.clickable { onLeaveRoomClicked(contextMenu.roomId) },
|
modifier = Modifier.clickable { onLeaveRoomClicked() },
|
||||||
leadingContent = ListItemContent.Icon(
|
leadingContent = ListItemContent.Icon(
|
||||||
iconSource = IconSource.Vector(
|
iconSource = IconSource.Vector(
|
||||||
CompoundIcons.Leave,
|
CompoundIcons.Leave,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue