File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed
Sources/StreamChatSwiftUI/ChatChannel/Reactions Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,8 @@ struct ReactionsAnimatableView: View {
113
113
onReactionTap ( reaction)
114
114
} label: {
115
115
Image ( uiImage: image)
116
- . customizable ( )
116
+ . resizable ( )
117
+ . scaledToFit ( )
117
118
. foregroundColor ( color ( for: reaction) )
118
119
. frame ( width: useLargeIcons ? 25 : 20 , height: useLargeIcons ? 27 : 20 )
119
120
}
@@ -157,9 +158,16 @@ struct ReactionsAnimatableView: View {
157
158
}
158
159
}
159
160
160
- private func color( for reaction: MessageReactionType ) -> Color {
161
- userReactionIDs
162
- . contains ( reaction) ? Color ( colors. highlightedAccentBackground) : Color ( colors. textLowEmphasis)
161
+ private func color( for reaction: MessageReactionType ) -> Color ? {
162
+ var colors = colors
163
+ let containsUserReaction = userReactionIDs. contains ( reaction)
164
+ let color = containsUserReaction ? colors. reactionCurrentUserColor : colors. reactionOtherUserColor
165
+
166
+ if let color = color {
167
+ return Color ( color)
168
+ } else {
169
+ return nil
170
+ }
163
171
}
164
172
165
173
private var userReactionIDs : Set < MessageReactionType > {
Original file line number Diff line number Diff line change @@ -74,7 +74,8 @@ struct ReactionsView: View {
74
74
ForEach ( reactions) { reaction in
75
75
if let image = iconProvider ( for: reaction) {
76
76
Image ( uiImage: image)
77
- . customizable ( )
77
+ . resizable ( )
78
+ . scaledToFit ( )
78
79
. foregroundColor ( color ( for: reaction) )
79
80
. frame ( width: useLargeIcons ? 25 : 20 , height: useLargeIcons ? 27 : 20 )
80
81
. gesture (
@@ -98,9 +99,16 @@ struct ReactionsView: View {
98
99
}
99
100
}
100
101
101
- private func color( for reaction: MessageReactionType ) -> Color {
102
- userReactionIDs
103
- . contains ( reaction) ? Color ( colors. highlightedAccentBackground) : Color ( colors. textLowEmphasis)
102
+ private func color( for reaction: MessageReactionType ) -> Color ? {
103
+ var colors = colors
104
+ let containsUserReaction = userReactionIDs. contains ( reaction)
105
+ let color = containsUserReaction ? colors. reactionCurrentUserColor : colors. reactionOtherUserColor
106
+
107
+ if let color = color {
108
+ return Color ( color)
109
+ } else {
110
+ return nil
111
+ }
104
112
}
105
113
106
114
private var userReactionIDs : Set < MessageReactionType > {
You can’t perform that action at this time.
0 commit comments