Skip to content

Commit b9baf08

Browse files
[PBIOS-671] Fix Reaction Button Font Color Alignment (#490)
**What does this PR do?** A clear and concise description with your runway ticket url. [PBIOS-671] Fix Reaction Button Font Color Alignment ### Checklist - [x] **LABELS** - Add a label: `breaking`, `bug`, `improvement`, `documentation`, or `enhancement`. See [Labels](https://github.com/powerhome/playbook-apple/labels) for descriptions. - [x] **RELEASES** - Add the appropriate label: `Ready for Testing` / `Ready for Release` - [x] **TESTING** - Have you tested your story? --------- Co-authored-by: Ísis <[email protected]>
1 parent 3c14027 commit b9baf08

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Diff for: Sources/Playbook/Components/Button/ButtonsCatalog.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import SwiftUI
1111

1212
public struct ButtonsCatalog: View {
13-
@State private var count: Int = 153
13+
@State private var count: Int = 154
1414
@State private var count1: Int = 5
1515
@State private var isLoading: Bool = false
1616
@State private var isHighlighted: Bool = true
@@ -66,8 +66,8 @@ extension ButtonsCatalog {
6666
isInteractive: true
6767
)
6868
PBReactionButton(count: $count1, icon: "1️⃣", isInteractive: false)
69-
PBReactionButton(isInteractive: false)
70-
PBReactionButton(pbIcon: PBIcon(FontAwesome.user), isInteractive: false)
69+
PBReactionButton(isInteractive: false, countColor: Color.text(.lighter))
70+
PBReactionButton(pbIcon: PBIcon(FontAwesome.user), isInteractive: false, countColor: Color.text(.lighter))
7171
}
7272
}
7373
var fullWidthButtonView: some View {

Diff for: Sources/Playbook/Components/Button/PBReactionButton.swift

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public struct PBReactionButton: View {
1616
let icon: String?
1717
let pbIcon: PBIcon?
1818
let isInteractive: Bool
19+
let countColor: Color
1920
let action: (() -> Void)?
2021
@Environment(\.colorScheme) var colorScheme
2122

@@ -25,12 +26,14 @@ public struct PBReactionButton: View {
2526
icon: String? = nil,
2627
pbIcon: PBIcon? = nil,
2728
isInteractive: Bool = false,
29+
countColor: Color = .text(.light),
2830
action: (() -> Void)? = nil
2931
) {
3032
self._count = count
3133
self._isHighlighted = isHighlighted
3234
self.icon = icon
3335
self.pbIcon = pbIcon
36+
self.countColor = countColor
3437
self.isInteractive = isInteractive
3538
self.action = action
3639
}
@@ -75,12 +78,12 @@ public extension PBReactionButton {
7578
countView
7679
}
7780
.padding(.horizontal, 8)
78-
.padding(.vertical, 2)
81+
.padding(.top, 3)
7982
}
8083

8184
var emojiView: some View {
8285
return Text(icon ?? "")
83-
.pbFont(.monogram(12), variant: .light, color: textColor)
86+
.pbFont(.caption, variant: .light, color: textColor)
8487
.padding(.leading, count > 0 ? 0 : 4)
8588
}
8689

@@ -107,7 +110,7 @@ public extension PBReactionButton {
107110

108111
var textColor: Color {
109112
switch colorScheme {
110-
case .light: return Color.text(.lighter)
113+
case .light: return countColor
111114
case .dark: return icon != nil ? Color(.white) : Color(.white).opacity(0.6)
112115
default:
113116
return Color.text(.light)

0 commit comments

Comments
 (0)