mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Knock Requests navigation flows (#3555)
* implemented navigations * better naming for the enum * removed list to banned users navigation * polished the code * avatarURL
This commit is contained in:
@@ -42,6 +42,7 @@ enum RoomScreenCoordinatorAction {
|
||||
case presentCallScreen
|
||||
case presentPinnedEventsTimeline
|
||||
case presentResolveSendFailure(failure: TimelineItemSendFailure.VerifiedUser, sendHandle: SendHandleProxy)
|
||||
case presentKnockRequestsList
|
||||
}
|
||||
|
||||
final class RoomScreenCoordinator: CoordinatorProtocol {
|
||||
@@ -169,6 +170,8 @@ final class RoomScreenCoordinator: CoordinatorProtocol {
|
||||
actionsSubject.send(.presentCallScreen)
|
||||
case .removeComposerFocus:
|
||||
composerViewModel.process(timelineAction: .removeFocus)
|
||||
case .displayKnockRequests:
|
||||
actionsSubject.send(.presentKnockRequestsList)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
@@ -14,6 +14,7 @@ enum RoomScreenViewModelAction {
|
||||
case displayRoomDetails
|
||||
case displayCall
|
||||
case removeComposerFocus
|
||||
case displayKnockRequests
|
||||
}
|
||||
|
||||
enum RoomScreenViewAction {
|
||||
@@ -22,6 +23,9 @@ enum RoomScreenViewAction {
|
||||
case displayRoomDetails
|
||||
case displayCall
|
||||
case footerViewAction(RoomScreenFooterViewAction)
|
||||
case acceptKnock(userID: String)
|
||||
case dismissKnockRequests
|
||||
case viewKnockRequests
|
||||
}
|
||||
|
||||
struct RoomScreenViewState: BindableState {
|
||||
|
||||
@@ -103,6 +103,14 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
case .resolvePinViolation(let userID):
|
||||
Task { await resolveIdentityPinningViolation(userID) }
|
||||
}
|
||||
case .acceptKnock(userID: let userID):
|
||||
// TODO: API to accept a knock required
|
||||
break
|
||||
case .dismissKnockRequests:
|
||||
// TODO: API to mark knocks as seen required
|
||||
break
|
||||
case .viewKnockRequests:
|
||||
actionsSubject.send(.displayKnockRequests)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -148,15 +148,15 @@ struct RoomScreen: View {
|
||||
}
|
||||
|
||||
private func dismissKnockRequestsBanner() {
|
||||
// TODO: Implement
|
||||
roomContext.send(viewAction: .dismissKnockRequests)
|
||||
}
|
||||
|
||||
private func acceptKnockRequest(userID: String) {
|
||||
// TODO: Implement
|
||||
roomContext.send(viewAction: .acceptKnock(userID: userID))
|
||||
}
|
||||
|
||||
private func onViewAllKnockRequests() {
|
||||
// TODO: Implement
|
||||
roomContext.send(viewAction: .viewKnockRequests)
|
||||
}
|
||||
|
||||
private var scrollToBottomButton: some View {
|
||||
|
||||
Reference in New Issue
Block a user