mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-06 04:18:31 +00:00
increas hit area for the media preview upload warning, and hide accessibility for the avatar in the mention suggestions view
This commit is contained in:
@@ -82,6 +82,9 @@ struct MediaUploadPreviewScreen: View {
|
|||||||
context.isPresentingMediaCaptionWarning = true
|
context.isPresentingMediaCaptionWarning = true
|
||||||
} label: {
|
} label: {
|
||||||
CompoundIcon(\.infoSolid, size: .xSmall, relativeTo: .compound.bodyLG)
|
CompoundIcon(\.infoSolid, size: .xSmall, relativeTo: .compound.bodyLG)
|
||||||
|
// Increase hit area
|
||||||
|
.padding(.leading, 5)
|
||||||
|
.padding(.vertical, 2)
|
||||||
}
|
}
|
||||||
.tint(.compound.iconCriticalPrimary)
|
.tint(.compound.iconCriticalPrimary)
|
||||||
.popover(isPresented: $context.isPresentingMediaCaptionWarning, arrowEdge: .bottom) {
|
.popover(isPresented: $context.isPresentingMediaCaptionWarning, arrowEdge: .bottom) {
|
||||||
|
|||||||
+15
-8
@@ -13,14 +13,8 @@ struct MentionSuggestionItemView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(alignment: .center, spacing: 16) {
|
HStack(alignment: .center, spacing: 16) {
|
||||||
switch item.suggestionType {
|
avatar
|
||||||
case .user(let user):
|
.accessibilityHidden(true)
|
||||||
LoadableAvatarImage(url: user.avatarURL, name: user.displayName, contentID: user.id, avatarSize: .user(on: .completionSuggestions), mediaProvider: mediaProvider)
|
|
||||||
case .allUsers(let avatar):
|
|
||||||
RoomAvatarImage(avatar: avatar, avatarSize: .room(on: .completionSuggestions), mediaProvider: mediaProvider)
|
|
||||||
case .room(let room):
|
|
||||||
RoomAvatarImage(avatar: room.avatar, avatarSize: .room(on: .completionSuggestions), mediaProvider: mediaProvider)
|
|
||||||
}
|
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
Text(item.displayName)
|
Text(item.displayName)
|
||||||
.font(.compound.bodyLG)
|
.font(.compound.bodyLG)
|
||||||
@@ -34,6 +28,19 @@ struct MentionSuggestionItemView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.accessibilityElement(children: .combine)
|
||||||
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
|
private var avatar: some View {
|
||||||
|
switch item.suggestionType {
|
||||||
|
case .user(let user):
|
||||||
|
LoadableAvatarImage(url: user.avatarURL, name: user.displayName, contentID: user.id, avatarSize: .user(on: .completionSuggestions), mediaProvider: mediaProvider)
|
||||||
|
case .allUsers(let avatar):
|
||||||
|
RoomAvatarImage(avatar: avatar, avatarSize: .room(on: .completionSuggestions), mediaProvider: mediaProvider)
|
||||||
|
case .room(let room):
|
||||||
|
RoomAvatarImage(avatar: room.avatar, avatarSize: .room(on: .completionSuggestions), mediaProvider: mediaProvider)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user