mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Combine DM call actions into one menu item
This helps give more space to the room header. Specially in the scenario when threads is enabled.
This commit is contained in:
@@ -24,14 +24,30 @@ struct RoomCallControlsToolbar: ToolbarContent {
|
|||||||
} else {
|
} else {
|
||||||
if viewState.isDirectOneToOneRoom {
|
if viewState.isDirectOneToOneRoom {
|
||||||
ToolbarItem(placement: .primaryAction) {
|
ToolbarItem(placement: .primaryAction) {
|
||||||
Button { onCallTap(true) } label: {
|
Menu {
|
||||||
CompoundIcon(\.voiceCallSolid)
|
Button(action: { onCallTap(true) }) {
|
||||||
|
Label("Audio call", systemImage: "phone.fill")
|
||||||
}
|
}
|
||||||
|
.accessibilityIdentifier(A11yIdentifiers.roomScreen.startVoiceCall)
|
||||||
|
.disabled(!viewState.canJoinCall)
|
||||||
|
|
||||||
|
Button(action: { onCallTap(false) }) {
|
||||||
|
Label("Video call", systemImage: "video.fill")
|
||||||
|
}
|
||||||
|
.accessibilityIdentifier(A11yIdentifiers.roomScreen.startVideoCall)
|
||||||
|
.disabled(!viewState.canJoinCall)
|
||||||
|
} label: {
|
||||||
|
CompoundIcon(\.voiceCallSolid)
|
||||||
|
.frame(width: 28, height: 28)
|
||||||
|
.contentShape(Rectangle())
|
||||||
|
}
|
||||||
|
.menuIndicator(.hidden)
|
||||||
|
.buttonStyle(.plain)
|
||||||
.accessibilityLabel(L10n.a11yStartVoiceCall)
|
.accessibilityLabel(L10n.a11yStartVoiceCall)
|
||||||
.accessibilityIdentifier(A11yIdentifiers.roomScreen.startVoiceCall)
|
.accessibilityIdentifier(A11yIdentifiers.roomScreen.startVoiceCall)
|
||||||
.disabled(!viewState.canJoinCall)
|
.disabled(!viewState.canJoinCall)
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
ToolbarItem(placement: .primaryAction) {
|
ToolbarItem(placement: .primaryAction) {
|
||||||
Button { onCallTap(false) } label: {
|
Button { onCallTap(false) } label: {
|
||||||
CompoundIcon(\.videoCallSolid)
|
CompoundIcon(\.videoCallSolid)
|
||||||
@@ -42,6 +58,7 @@ struct RoomCallControlsToolbar: ToolbarContent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Previews
|
// MARK: - Previews
|
||||||
|
|||||||
Reference in New Issue
Block a user