Fixes #2790 - Reorder available composer menu actions

This commit is contained in:
Stefan Ceriu
2024-05-07 17:04:25 +03:00
committed by Stefan Ceriu
parent bd4fae6086
commit a08b4842d1
6 changed files with 38 additions and 37 deletions
@@ -37,13 +37,31 @@ struct RoomAttachmentPicker: View {
var menuContent: some View {
VStack(alignment: .leading, spacing: 0.0) {
if ServiceLocator.shared.settings.richTextEditorEnabled {
Button {
context.send(viewAction: .enableTextFormatting)
} label: {
Label(L10n.screenRoomAttachmentTextFormatting, icon: \.textFormatting)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerTextFormatting)
}
Button {
context.send(viewAction: .attach(.photoLibrary))
context.send(viewAction: .attach(.poll))
} label: {
Label(L10n.screenRoomAttachmentSourceGallery, icon: \.image)
Label(L10n.screenRoomAttachmentSourcePoll, icon: \.polls)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPhotoLibrary)
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPoll)
Button {
context.send(viewAction: .attach(.location))
} label: {
Label(L10n.screenRoomAttachmentSourceLocation, icon: \.locationPin)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerLocation)
Button {
context.send(viewAction: .attach(.file))
@@ -53,6 +71,14 @@ struct RoomAttachmentPicker: View {
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerDocuments)
Button {
context.send(viewAction: .attach(.photoLibrary))
} label: {
Label(L10n.screenRoomAttachmentSourceGallery, icon: \.image)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPhotoLibrary)
Button {
context.send(viewAction: .attach(.camera))
} label: {
@@ -60,32 +86,6 @@ struct RoomAttachmentPicker: View {
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerCamera)
Button {
context.send(viewAction: .attach(.location))
} label: {
Label(L10n.screenRoomAttachmentSourceLocation, icon: \.locationPin)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerLocation)
Button {
context.send(viewAction: .attach(.poll))
} label: {
Label(L10n.screenRoomAttachmentSourcePoll, icon: \.polls)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPoll)
if ServiceLocator.shared.settings.richTextEditorEnabled {
Button {
context.send(viewAction: .enableTextFormatting)
} label: {
Label(L10n.screenRoomAttachmentTextFormatting, icon: \.textFormatting)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerTextFormatting)
}
}
}
}