diff --git a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootEvents.kt b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootEvents.kt index 5c051abf69..820d071866 100644 --- a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootEvents.kt +++ b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootEvents.kt @@ -16,7 +16,7 @@ package io.element.android.features.createroom.root -// TODO Add your events or remove the file completely if no events sealed interface CreateRoomRootEvents { - object MyEvent : CreateRoomRootEvents + object CreateRoom : CreateRoomRootEvents + object InvitePeople : CreateRoomRootEvents } diff --git a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootNode.kt b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootNode.kt index 1929926df5..8d3d41b434 100644 --- a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootNode.kt +++ b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootNode.kt @@ -47,8 +47,6 @@ class CreateRoomRootNode @AssistedInject constructor( state = state, modifier = modifier, onClosePressed = this::navigateUp, - onNewRoomClicked = { /* TODO Handle new room action */ }, - onInvitePeopleClicked = { /* TODO Handle invite people action */ }, ) } } diff --git a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootPresenter.kt b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootPresenter.kt index 287e4d6e42..ad93d9143d 100644 --- a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootPresenter.kt +++ b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootPresenter.kt @@ -27,7 +27,8 @@ class CreateRoomRootPresenter @Inject constructor() : Presenter Unit + CreateRoomRootEvents.CreateRoom -> Unit // Todo Handle create room action + CreateRoomRootEvents.InvitePeople -> Unit // Todo Handle invite people action } } diff --git a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootScreen.kt b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootScreen.kt index d04eb22bd1..889207265e 100644 --- a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootScreen.kt +++ b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootScreen.kt @@ -63,8 +63,6 @@ fun CreateRoomRootScreen( state: CreateRoomRootState, modifier: Modifier = Modifier, onClosePressed: () -> Unit = {}, - onNewRoomClicked: () -> Unit = {}, - onInvitePeopleClicked: () -> Unit = {}, ) { var searchText by rememberSaveable { mutableStateOf("") } var isSearchActive by rememberSaveable { mutableStateOf(false) } @@ -91,8 +89,8 @@ fun CreateRoomRootScreen( if (!isSearchActive) { CreateRoomActionButtonsList( - onNewRoomClicked = onNewRoomClicked, - onInvitePeopleClicked = onInvitePeopleClicked, + onNewRoomClicked = { state.eventSink(CreateRoomRootEvents.CreateRoom) }, + onInvitePeopleClicked = { state.eventSink(CreateRoomRootEvents.InvitePeople) }, ) } } diff --git a/features/createroom/src/test/kotlin/io/element/android/features/createroom/root/CreateRoomRootPresenterTests.kt b/features/createroom/src/test/kotlin/io/element/android/features/createroom/root/CreateRoomRootPresenterTests.kt index c57c24d75c..c03b48efa8 100644 --- a/features/createroom/src/test/kotlin/io/element/android/features/createroom/root/CreateRoomRootPresenterTests.kt +++ b/features/createroom/src/test/kotlin/io/element/android/features/createroom/root/CreateRoomRootPresenterTests.kt @@ -46,7 +46,8 @@ class CreateRoomRootPresenterTests { presenter.present() }.test { val initialState = awaitItem() - initialState.eventSink.invoke(CreateRoomRootEvents.MyEvent) + initialState.eventSink(CreateRoomRootEvents.CreateRoom) // Not implemented yet + initialState.eventSink(CreateRoomRootEvents.InvitePeople) // Not implemented yet } } }