Update polls icons (#2163)

* Add new polls icons

* Fix preview tests

* Update UI tests

* Add polls reply view test
This commit is contained in:
Alfonso Grillo
2023-11-24 15:39:53 +01:00
committed by GitHub
parent 59eb253980
commit 81373b0d98
49 changed files with 92 additions and 619 deletions
@@ -80,7 +80,7 @@ struct TimelineReplyView: View {
ReplyView(sender: sender,
plainBody: question,
formattedBody: nil,
icon: .init(kind: .iconAsset(Asset.Images.timelinePoll), cornerRadii: iconCornerRadii))
icon: .init(kind: .iconAsset(Asset.Images.polls), cornerRadii: iconCornerRadii))
}
default:
LoadingReplyView()
@@ -112,7 +112,7 @@ struct TimelineReplyView: View {
case iconAsset(ImageAsset)
case icon(KeyPath<CompoundIcons, Image>)
}
let kind: Kind
let cornerRadii: Double
}
@@ -292,7 +292,10 @@ struct TimelineReplyView_Previews: PreviewProvider, TestablePreview {
eventContent: .message(.notice(.init(body: "", formattedBody: attributedStringWithMention))))),
TimelineReplyView(placement: .timeline,
timelineItemReplyDetails: .loaded(sender: .init(id: "", displayName: "Bob"),
eventContent: .message(.notice(.init(body: "", formattedBody: attributedStringWithAtRoomMention)))))
eventContent: .message(.notice(.init(body: "", formattedBody: attributedStringWithAtRoomMention))))),
TimelineReplyView(placement: .timeline,
timelineItemReplyDetails: .loaded(sender: .init(id: "", displayName: "Bob"),
eventContent: .poll(question: "Do you like polls?")))
]
}
@@ -47,7 +47,7 @@ struct PollRoomTimelineView: View {
private var questionView: some View {
HStack(alignment: .top, spacing: 12) {
let asset = poll.hasEnded ? Asset.Images.timelineEndedPoll : Asset.Images.timelinePoll
let asset = poll.hasEnded ? Asset.Images.pollsEnd : Asset.Images.polls
Image(asset.name)
.resizable()
@@ -121,7 +121,7 @@ enum TimelineItemMenuAction: Identifiable, Hashable {
case .react:
Label(L10n.actionReact, iconAsset: Asset.Images.addReaction)
case .endPoll:
Label(L10n.actionEndPoll, iconAsset: Asset.Images.endedPoll)
Label(L10n.actionEndPoll, iconAsset: Asset.Images.pollsEnd)
}
}
}