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

View File

@ -37,29 +37,23 @@ struct RoomAttachmentPicker: View {
var menuContent: some View {
VStack(alignment: .leading, spacing: 0.0) {
if ServiceLocator.shared.settings.richTextEditorEnabled {
Button {
context.send(viewAction: .attach(.photoLibrary))
context.send(viewAction: .enableTextFormatting)
} label: {
Label(L10n.screenRoomAttachmentSourceGallery, icon: \.image)
Label(L10n.screenRoomAttachmentTextFormatting, icon: \.textFormatting)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPhotoLibrary)
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerTextFormatting)
}
Button {
context.send(viewAction: .attach(.file))
context.send(viewAction: .attach(.poll))
} label: {
Label(L10n.screenRoomAttachmentSourceFiles, icon: \.attachment)
Label(L10n.screenRoomAttachmentSourcePoll, icon: \.polls)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerDocuments)
Button {
context.send(viewAction: .attach(.camera))
} label: {
Label(L10n.screenRoomAttachmentSourceCamera, icon: \.takePhoto)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerCamera)
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPoll)
Button {
context.send(viewAction: .attach(.location))
@ -70,22 +64,28 @@ struct RoomAttachmentPicker: View {
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerLocation)
Button {
context.send(viewAction: .attach(.poll))
context.send(viewAction: .attach(.file))
} label: {
Label(L10n.screenRoomAttachmentSourcePoll, icon: \.polls)
Label(L10n.screenRoomAttachmentSourceFiles, icon: \.attachment)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPoll)
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerDocuments)
if ServiceLocator.shared.settings.richTextEditorEnabled {
Button {
context.send(viewAction: .enableTextFormatting)
context.send(viewAction: .attach(.photoLibrary))
} label: {
Label(L10n.screenRoomAttachmentTextFormatting, icon: \.textFormatting)
Label(L10n.screenRoomAttachmentSourceGallery, icon: \.image)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerTextFormatting)
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerPhotoLibrary)
Button {
context.send(viewAction: .attach(.camera))
} label: {
Label(L10n.screenRoomAttachmentSourceCamera, icon: \.takePhoto)
.labelStyle(.menuSheet)
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.attachmentPickerCamera)
}
}
}

1
changelog.d/2790.change Normal file
View File

@ -0,0 +1 @@
Reorder available composer menu actions