mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:11:45 +00:00
Update message composer design for unencrypted rooms (#4361)
* Update message composer design for unencrypted rooms. * Move the encryption banner to the composer toolbar.
This commit is contained in:
@@ -42,10 +42,25 @@ struct ComposerToolbar: View {
|
||||
}
|
||||
}
|
||||
.readFrame($frame)
|
||||
.safeAreaInset(edge: .top) {
|
||||
if !context.viewState.isRoomEncrypted {
|
||||
Label {
|
||||
Text(L10n.commonNotEncrypted)
|
||||
.font(.compound.bodySM)
|
||||
.foregroundStyle(.compound.textSecondary)
|
||||
} icon: {
|
||||
CompoundIcon(\.lockOff, size: .xSmall, relativeTo: .compound.bodyMD)
|
||||
.foregroundStyle(.compound.iconInfoPrimary)
|
||||
}
|
||||
.padding(4.0)
|
||||
}
|
||||
}
|
||||
.overlay(alignment: .bottom) {
|
||||
if verticalSizeClass != .compact, !context.composerExpanded {
|
||||
suggestionView
|
||||
.offset(y: -frame.height)
|
||||
ZStack {
|
||||
if verticalSizeClass != .compact, !context.composerExpanded {
|
||||
suggestionView
|
||||
.offset(y: -frame.height)
|
||||
}
|
||||
}
|
||||
}
|
||||
.disabled(!context.viewState.canSend)
|
||||
@@ -162,8 +177,7 @@ struct ComposerToolbar: View {
|
||||
placeholder: placeholder,
|
||||
composerFormattingEnabled: context.composerFormattingEnabled,
|
||||
showResizeGrabber: context.composerFormattingEnabled,
|
||||
isExpanded: $context.composerExpanded,
|
||||
isEncrypted: context.viewState.isRoomEncrypted) {
|
||||
isExpanded: $context.composerExpanded) {
|
||||
sendMessage()
|
||||
} editAction: {
|
||||
context.send(viewAction: .editLastMessage)
|
||||
@@ -236,11 +250,7 @@ struct ComposerToolbar: View {
|
||||
}
|
||||
|
||||
private var composerPlaceholder: String {
|
||||
if context.viewState.isRoomEncrypted {
|
||||
return L10n.richTextEditorComposerPlaceholder
|
||||
} else {
|
||||
return L10n.richTextEditorComposerUnencryptedPlaceholder
|
||||
}
|
||||
L10n.richTextEditorComposerPlaceholder
|
||||
}
|
||||
|
||||
private var composerView: WysiwygComposerView {
|
||||
|
||||
Reference in New Issue
Block a user