Fix reaction height issue (#1482)

- Fix reaction height issue
- Add regression test
- Fix reaction summary button color for text based reactions
This commit is contained in:
David Langley
2023-08-11 17:49:59 +01:00
committed by GitHub
parent 9a52b968f1
commit 4503e6e0cc
3 changed files with 55 additions and 8 deletions
@@ -95,10 +95,11 @@ private struct ReactionSummaryButton: View {
HStack(spacing: 4) {
Text(reaction.displayKey)
.font(.compound.headingSM)
.foregroundColor(textColor)
if reaction.count > 1 {
Text(String(reaction.count))
.font(.compound.headingSM)
.foregroundColor(highlighted ? Color.compound.textOnSolidPrimary : Color.compound.textSecondary)
.foregroundColor(textColor)
}
}
.padding(.vertical, 8)
@@ -106,6 +107,10 @@ private struct ReactionSummaryButton: View {
.background(highlighted ? Color.compound.bgActionPrimaryRest : .clear, in: Capsule())
.accessibilityElement(children: .combine)
}
var textColor: Color {
highlighted ? Color.compound.textOnSolidPrimary : Color.compound.textSecondary
}
}
private struct ReactionSummarySenderView: View {