fun UserInvitationScreen(navController: NavController?, channelUrl: String, modifier: Modifier = Modifier, userInvitationScreenState: UserInvitationScreenState = rememberUserInvitationScreenState(), snackbarHostState: SnackbarHostState = remember { SnackbarHostState() }, viewModelContract: UserInvitationViewModelContract = viewModel<UserInvitationViewModel>(
factory = UserInvitationViewModel.factory(
UserInvitationViewModelParams(channelUrl)
)
), onTopBarNavigationIconClick: () -> Unit = { navController?.popBackStack() }, onTopBarActionClick: (UserInvitationScreenState, UserInvitationTopBarActionContract) -> Unit = { state, topBarActionContract ->
topBarActionContract.invite(state.selectedUserIds)
}, onInvited: (channelUrl: String) -> Unit = {
navController?.popBackStack(SendbirdNavigationRoute.Channel(it).route, inclusive = false)
}, onChannelRemoved: (channelUrl: String) -> Unit = {
navController?.popBackStack(SendbirdNavigationRoute.Channels.route, inclusive = false)
}, topBar: @Composable (selectedUserCount: Int, onNavigationIconClick: () -> Unit, onActionClick: () -> Unit) -> Unit = { selectedUserCount, onNavigationIconClick, onActionClick ->
UserInvitationTopBar(
selectedUserCount,
onNavigationIconClick = onNavigationIconClick,
onActionClick = onActionClick
)
}, loading: @Composable () -> Unit = {
LoadingScreen()
}, failure: @Composable (e: Throwable) -> Unit = { e ->
FailurePlaceholder(
onRetryClick = { viewModelContract.prepare() }
)
}, empty: @Composable () -> Unit = {
ScreenPlaceholder(
icon = painterResource(id = R.drawable.icon_members),
text = stringResource(id = R.string.sb_text_user_list_empty)
)
}, userItem: @Composable (user: UikitUser, isSelected: Boolean, isMember: Boolean, onCheckedChange: (user: UikitUser) -> Unit) -> Unit = { user, isSelected, isMember, onCheckedChange ->
UserInvitationItem(
user,
isSelected,
isMember = isMember
) {
onCheckedChange(it)
}
UserItemDivider()
}) Represents the screen for inviting users to a channel.
Since
1.0.0-beta.1
Parameters
The url of the channel to invite users to.
The modifier to be applied to the view.
userInvitationScreenState
onTopBarNavigationIconClick
The action to be executed when the top bar navigation icon is clicked.
The action to be executed when the users are invited.
The action to be executed when the channel is deleted.
See also