color improvements and implementing the cancel callback

This commit is contained in:
Mauro Romito
2022-10-11 19:58:22 +02:00
parent 9a7900fe3a
commit 516ab24c37
5 changed files with 95 additions and 26 deletions
@@ -19,6 +19,14 @@ import SwiftUI
typealias ComposerViewModelType = StateStoreViewModel<ComposerViewState, ComposerViewAction>
class ComposerViewModel: ComposerViewModelType, ComposerViewModelProtocol {
// MARK: - Properties
// MARK: Private
// MARK: Public
var callback: ((ComposerViewModelResult) -> Void)?
// MARK: - Public
func setSendMode(_ sendMode: RoomInputToolbarViewSendMode) {
state.sendMode = sendMode
}
@@ -26,4 +34,11 @@ class ComposerViewModel: ComposerViewModelType, ComposerViewModelProtocol {
func setEventSenderDisplayName(_ eventSenderDisplayName: String?) {
state.eventSenderDisplayName = eventSenderDisplayName
}
override func process(viewAction: ComposerViewAction) {
switch viewAction {
case .cancel:
callback?(.cancel)
}
}
}