feat: move pinned messages button to menu
This commit is contained in:
parent
058dcbcd50
commit
8c5f0a143f
|
|
@ -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)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,11 @@ import chat.stoat.api.internals.ChannelUtils
|
||||||
import chat.stoat.api.internals.PermissionBit
|
import chat.stoat.api.internals.PermissionBit
|
||||||
import chat.stoat.api.internals.Roles
|
import chat.stoat.api.internals.Roles
|
||||||
import chat.stoat.api.internals.has
|
import chat.stoat.api.internals.has
|
||||||
import chat.stoat.core.model.schemas.ChannelType
|
|
||||||
import chat.stoat.callbacks.Action
|
import chat.stoat.callbacks.Action
|
||||||
import chat.stoat.callbacks.ActionChannel
|
import chat.stoat.callbacks.ActionChannel
|
||||||
import chat.stoat.composables.generic.SheetButton
|
import chat.stoat.composables.generic.SheetButton
|
||||||
import chat.stoat.composables.screens.chat.ChannelSheetHeader
|
import chat.stoat.composables.screens.chat.ChannelSheetHeader
|
||||||
|
import chat.stoat.core.model.schemas.ChannelType
|
||||||
import chat.stoat.internals.extensions.rememberChannelPermissions
|
import chat.stoat.internals.extensions.rememberChannelPermissions
|
||||||
import chat.stoat.screens.chat.dialogs.InviteDialog
|
import chat.stoat.screens.chat.dialogs.InviteDialog
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
|
@ -199,6 +199,28 @@ fun ChannelInfoSheet(channelId: String, onHideSheet: suspend () -> Unit) {
|
||||||
onClick = {}
|
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 (
|
if (
|
||||||
(permissions has PermissionBit.ManageChannel || permissions has PermissionBit.ManageRole)
|
(permissions has PermissionBit.ManageChannel || permissions has PermissionBit.ManageRole)
|
||||||
&& (channel.channelType != ChannelType.SavedMessages && channel.channelType != ChannelType.DirectMessage)
|
&& (channel.channelType != ChannelType.SavedMessages && channel.channelType != ChannelType.DirectMessage)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue