UserInvitationScreen

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

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.

viewModelContract

The UserInvitationViewModelContract 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