UserInvitationScreen

fun UserInvitationScreen(navController: NavController?, channelUrl: String, modifier: Modifier = Modifier, userInvitationScreenState: UserInvitationScreenState = rememberUserInvitationScreenState(), viewModel: UserInvitationViewModel = viewModel( factory = UserInvitationViewModel.factory( UserInvitationViewModelParams(channelUrl) ) ), onTopBarNavigationIconClick: () -> Unit = { navController?.popBackStack() }, onTopBarActionClick: (UserInvitationScreenState, UserInvitationViewModel) -> Unit = { state, vm -> vm.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 -> if (e !is ChannelRemovedException) { FailurePlaceholder( onRetryClick = { viewModel.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, modifier = Modifier.clickable { if (isMember.not()) onCheckedChange(user) }, isMember = isMember ) { onCheckedChange(it) } HorizontalDivider( modifier = Modifier.padding(start = 68.dp), color = MaterialTheme.colorScheme.onBackground.copy(alpha = SendbirdOpacity.ExtraLowOpacity) ) })

Represents the screen for inviting users to a channel.

Since

1.0.0-beta.1

Parameters

channelUrl

The url of the channel to invite users to.

modifier

The modifier to be applied to the view.

userInvitationScreenState

The UserInvitationScreenState to handle user selection.

viewModel

The UserInvitationViewModel to handle the business logic.

onTopBarNavigationIconClick

The action to be executed when the top bar navigation icon is clicked.

onTopBarActionClick

The action to be executed when the top bar action is clicked. Defaults to UserInvitationViewModel.invite.

onInvited

The action to be executed when the users are invited.

onChannelRemoved

The action to be executed when the channel is deleted.

topBar

The top bar to be shown. Defaults to UserInvitationTopBar.

loading

The loading screen to be shown. Defaults to LoadingScreen.

failure

The failure screen to be shown. Defaults to FailurePlaceholder.

empty

The empty screen to be shown. Defaults to ScreenPlaceholder.

userItem

The item to be shown for each user in LazyColumn. Defaults to UserInvitationItem.

See also