Skip to content

Commit

Permalink
🐛 Ensure an error color overrides rich text coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaatttt committed Mar 28, 2023
1 parent 3969783 commit 2b9f49e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal struct AppcuesText: View {

@available(iOS 13.0, *)
extension Text {
init(textModel: ExperienceComponent.TextModel) {
init(textModel: ExperienceComponent.TextModel, skipColor: Bool = false) {
self.init("")

// Note: a ViewBuilder approach here doesn't work because the requirement that we operate strictly on `Text`
Expand All @@ -41,7 +41,7 @@ extension Text {
text = text.font(font)
}

if let foregroundColor = Color(dynamicColor: span.style?.foregroundColor) {
if !skipColor, let foregroundColor = Color(dynamicColor: span.style?.foregroundColor) {
text = text.foregroundColor(foregroundColor)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal struct TintedTextView: View {
var body: some View {
let style = AppcuesStyle(from: model.style)

Text(textModel: model)
Text(textModel: model, skipColor: tintColor != nil)
.applyTextStyle(style, model: model)
.setupActions(on: viewModel, for: model)
.ifLet(tintColor) { view, val in
Expand Down

0 comments on commit 2b9f49e

Please sign in to comment.