Show bottom sheet in rename session screen

This commit is contained in:
Alfonso Grillo
2022-10-28 15:55:46 +02:00
parent b5b6154a39
commit 7fd958be86
5 changed files with 15 additions and 4 deletions
@@ -58,6 +58,8 @@ final class UserSessionNameCoordinator: Coordinator, Presentable {
self.updateName(newName)
case .cancel:
self.completion?(.cancel)
case .learnMore:
self.completion?(.learnMore)
}
}
}
@@ -23,6 +23,8 @@ 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
@@ -32,6 +34,8 @@ enum UserSessionNameViewModelResult {
case cancel
/// Update the session name to the supplied string.
case updateName(String)
/// The user tapped the learn more button.
case learnMore
}
// MARK: View
@@ -52,8 +56,6 @@ struct UserSessionNameBindings {
var sessionName: String
/// The currently displayed alert's info value otherwise `nil`.
var alertInfo: AlertInfo<Int>?
/// Specifies if the informational bottom sheet is onscreen or not
var showBottomSheet: Bool = false
}
enum UserSessionNameViewAction {
@@ -61,4 +63,6 @@ enum UserSessionNameViewAction {
case done
/// The user tapped the cancel button.
case cancel
/// The user tapped the learn more button.
case learnMore
}
@@ -34,6 +34,8 @@ class UserSessionNameViewModel: UserSessionNameViewModelType, UserSessionNameVie
completion?(.updateName(state.bindings.sessionName))
case .cancel:
completion?(.cancel)
case .learnMore:
completion?(.learnMore)
}
}
@@ -39,8 +39,7 @@ struct UserSessionName: View {
InlineTextButton(VectorL10n.manageSessionNameInfo("%@"),
tappableText: VectorL10n.manageSessionNameInfoLink) {
hideKeyboard()
viewModel.showBottomSheet = true
viewModel.send(viewAction: .learnMore)
}
.foregroundColor(theme.colors.secondaryContent)
}