Package-level declarations
Functions
Link copied to clipboard
fun ChannelHeader(channel: Channel, currentUser: User?, connectionState: ConnectionState, modifier: Modifier = Modifier, typingUsers: List<User> = emptyList(), messageMode: MessageMode = MessageMode.Normal, onBackPressed: () -> Unit = {}, onHeaderTitleClick: (Channel) -> Unit? = null, onChannelAvatarClick: (Channel) -> Unit? = null, leadingContent: @Composable RowScope.() -> Unit = {
with(ChatTheme.componentFactory) {
ChannelHeaderLeadingContent(
params = ChannelHeaderLeadingContentParams(
onBackPressed = onBackPressed,
),
)
}
}, centerContent: @Composable RowScope.() -> Unit = {
with(ChatTheme.componentFactory) {
ChannelHeaderCenterContent(
params = ChannelHeaderCenterContentParams(
modifier = Modifier.weight(1f),
channel = channel,
currentUser = currentUser,
connectionState = connectionState,
typingUsers = typingUsers,
messageMode = messageMode,
onClick = onHeaderTitleClick,
),
)
}
}, trailingContent: @Composable RowScope.() -> Unit = {
with(ChatTheme.componentFactory) {
ChannelHeaderTrailingContent(
params = ChannelHeaderTrailingContentParams(
channel = channel,
currentUser = currentUser,
onClick = onChannelAvatarClick,
),
)
}
})
A clean, decoupled UI element that doesn't rely on ViewModels or our custom architecture setup. This allows the user to fully govern how the ChannelHeader behaves, by passing in all the data that's required to display it and drive its actions, as well as customize the slot APIs.