Show rename sheet

This commit is contained in:
Alfonso Grillo
2022-10-28 16:17:19 +02:00
parent 088fc59c6c
commit c2440520cb
3 changed files with 21 additions and 7 deletions
@@ -59,7 +59,9 @@ final class UserSessionNameCoordinator: Coordinator, Presentable {
case .cancel:
self.completion?(.cancel)
case .learnMore:
self.completion?(.learnMore)
self.showInfoSheet(parameters: .init(title: VectorL10n.userSessionRenameSessionTitle,
description: VectorL10n.userSessionRenameSessionDescription,
action: .init(text: VectorL10n.userSessionGotIt, action: {})))
}
}
}
@@ -97,4 +99,22 @@ final class UserSessionNameCoordinator: Coordinator, Presentable {
private func stopLoading() {
loadingIndicator = nil
}
private func showInfoSheet(parameters: InfoSheetCoordinatorParameters) {
let coordinator = InfoSheetCoordinator(parameters: parameters)
coordinator.completion = { [weak self, weak coordinator] result in
guard let self = self, let coordinator = coordinator else { return }
switch result {
case .actionTriggered:
self.toPresentable().dismiss(animated: true)
self.remove(childCoordinator: coordinator)
}
}
add(childCoordinator: coordinator)
coordinator.start()
toPresentable().present(coordinator.toPresentable(), animated: true)
}
}
@@ -23,8 +23,6 @@ enum UserSessionNameCoordinatorResult {
case cancel
/// The user successfully updated the name of the session.
case sessionNameUpdated
/// The user tapped the learn more button.
case learnMore
}
// MARK: View model