feat: move pinned messages button to menu

This commit is contained in:
infi 2026-03-07 23:58:23 +01:00
parent 058dcbcd50
commit 8c5f0a143f
2 changed files with 23 additions and 13 deletions

View File

@ -639,18 +639,6 @@ fun ChannelScreen(
)
}
}
},
actions = {
IconButton(onClick = {
scope.launch {
ActionChannel.send(Action.TopNavigate("channel/$channelId/pins"))
}
}) {
Icon(
painter = painterResource(R.drawable.ic_pinboard_24dp),
contentDescription = stringResource(id = R.string.pinned_messages_view)
)
}
}
)
}

View File

@ -31,11 +31,11 @@ import chat.stoat.api.internals.ChannelUtils
import chat.stoat.api.internals.PermissionBit
import chat.stoat.api.internals.Roles
import chat.stoat.api.internals.has
import chat.stoat.core.model.schemas.ChannelType
import chat.stoat.callbacks.Action
import chat.stoat.callbacks.ActionChannel
import chat.stoat.composables.generic.SheetButton
import chat.stoat.composables.screens.chat.ChannelSheetHeader
import chat.stoat.core.model.schemas.ChannelType
import chat.stoat.internals.extensions.rememberChannelPermissions
import chat.stoat.screens.chat.dialogs.InviteDialog
import kotlinx.coroutines.delay
@ -199,6 +199,28 @@ fun ChannelInfoSheet(channelId: String, onHideSheet: suspend () -> Unit) {
onClick = {}
)
SheetButton(
headlineContent = {
Text(
text = stringResource(id = R.string.pinned_messages_view),
)
},
leadingContent = {
Icon(
painter = painterResource(R.drawable.ic_pinboard_24dp),
contentDescription = null
)
},
onClick = {
scope.launch {
onHideSheet()
}
scope.launch {
ActionChannel.send(Action.TopNavigate("channel/${channel.id}/pins"))
}
}
)
if (
(permissions has PermissionBit.ManageChannel || permissions has PermissionBit.ManageRole)
&& (channel.channelType != ChannelType.SavedMessages && channel.channelType != ChannelType.DirectMessage)