Show room encryption state in the composer (#3841)

* Fixes #3835 - Show room encryption state in the composer

* Update the preview test snapshots

* Update the UI test snapshots.
This commit is contained in:
Stefan Ceriu
2025-02-27 22:16:26 +02:00
committed by GitHub
parent 8648f55b5d
commit 890687512f
92 changed files with 258 additions and 180 deletions
@@ -157,9 +157,11 @@ struct ComposerToolbar: View {
selectedRange: $context.selectedRange,
composerView: composerView,
mode: context.viewState.composerMode,
placeholder: placeholder,
composerFormattingEnabled: context.composerFormattingEnabled,
showResizeGrabber: context.composerFormattingEnabled,
isExpanded: $context.composerExpanded) {
isExpanded: $context.composerExpanded,
isEncrypted: context.viewState.isRoomEncrypted) {
sendMessage()
} editAction: {
context.send(viewAction: .editLastMessage)
@@ -222,8 +224,16 @@ struct ComposerToolbar: View {
private var placeholder: String {
switch context.viewState.composerMode {
case .reply(_, _, let isThread):
return isThread ? L10n.actionReplyInThread : L10n.richTextEditorComposerPlaceholder
return isThread ? L10n.actionReplyInThread : composerPlaceholder
default:
return composerPlaceholder
}
}
private var composerPlaceholder: String {
if context.viewState.isRoomEncrypted {
return L10n.richTextEditorComposerEncryptedPlaceholder
} else {
return L10n.richTextEditorComposerPlaceholder
}
}