Skip to content

Commit

Permalink
Fix some lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdholtz committed Jan 29, 2025
1 parent 00543c5 commit 8a06164
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ struct ButtonComponentView: View {
#if canImport(SafariServices) && canImport(UIKit)
.sheet(isPresented: .isNotNil($inAppBrowserURL)) {
SafariView(url: inAppBrowserURL!)
}.presentCustomerCenter(isPresented: $showCustomerCenter) {
}.presentCustomerCenter(isPresented: $showCustomerCenter, onDismiss: {
showCustomerCenter = false
}
})
#endif
}

Expand Down
52 changes: 27 additions & 25 deletions RevenueCatUI/Templates/V2/ViewHelpers/Fill.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,35 @@ extension Shape {
_ color: DisplayableColorScheme,
colorScheme: ColorScheme
) -> some View {
let effectiveColor = color.effectiveColor(for: colorScheme)
switch effectiveColor {
case .hex:
// Do not apply a clear text color
// Use the default color
if color.hasError {
return self
} else {
return self.fill(color.toDynamicColor())
}
case .linear(let degrees, _):
return self.fill(
LinearGradient(
gradient: effectiveColor.toGradient(),
startPoint: UnitPoint(angle: Angle(degrees: Double(degrees))),
endPoint: UnitPoint(angle: Angle(degrees: Double(degrees+180)))
Group {
let effectiveColor = color.effectiveColor(for: colorScheme)
switch effectiveColor {
case .hex:
// Do not apply a clear text color
// Use the default color
if color.hasError {
self
} else {
self.fill(color.toDynamicColor())
}
case .linear(let degrees, _):
self.fill(
LinearGradient(
gradient: effectiveColor.toGradient(),
startPoint: UnitPoint(angle: Angle(degrees: Double(degrees))),
endPoint: UnitPoint(angle: Angle(degrees: Double(degrees+180)))
)
)
)
case .radial:
return self.fill(
RadialGradient(
gradient: effectiveColor.toGradient(),
center: .center,
startRadius: 0,
endRadius: 100
case .radial:
self.fill(
RadialGradient(
gradient: effectiveColor.toGradient(),
center: .center,
startRadius: 0,
endRadius: 100
)
)
)
}
}

}
Expand Down

0 comments on commit 8a06164

Please sign in to comment.