mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 00:49:44 +00:00
Seamlessly switch for the RichTextEditor based message composer to the… (#2753)
* Seemlesly switch for the RichTextEditor based message composer to the plain one depending on whether formatting options are enabled or not. * Address PR comments * Fixes #2803 - Add extra padding at the bottom of the composer suggestions list * Update preview test snapshots * Update UI test snapshots
This commit is contained in:
@@ -60,6 +60,7 @@ enum ComposerToolbarViewAction {
|
||||
case voiceMessage(ComposerToolbarVoiceMessageAction)
|
||||
|
||||
case plainComposerTextChanged
|
||||
case didToggleFormattingOptions
|
||||
}
|
||||
|
||||
enum ComposerAttachmentType {
|
||||
@@ -95,7 +96,7 @@ struct ComposerToolbarViewState: BindableState {
|
||||
case .previewVoiceMessage:
|
||||
return true
|
||||
default:
|
||||
if ServiceLocator.shared.settings.richTextEditorEnabled {
|
||||
if bindings.composerFormattingEnabled {
|
||||
return !composerEmpty
|
||||
} else {
|
||||
return !bindings.plainComposerText.string.isEmpty
|
||||
@@ -108,7 +109,7 @@ struct ComposerToolbarViewState: BindableState {
|
||||
return false
|
||||
}
|
||||
|
||||
if ServiceLocator.shared.settings.richTextEditorEnabled {
|
||||
if bindings.composerFormattingEnabled {
|
||||
return composerEmpty
|
||||
} else {
|
||||
return bindings.plainComposerText.string.isEmpty
|
||||
@@ -128,7 +129,7 @@ struct ComposerToolbarViewState: BindableState {
|
||||
struct ComposerToolbarViewStateBindings {
|
||||
var plainComposerText: NSAttributedString = .init(string: "")
|
||||
var composerFocused = false
|
||||
var composerActionsEnabled = false
|
||||
var composerFormattingEnabled = false
|
||||
var composerExpanded = false
|
||||
var formatItems: [FormatItem] = .init()
|
||||
var alertInfo: AlertInfo<UUID>?
|
||||
|
||||
Reference in New Issue
Block a user