diff --git a/RevenueCatUI/Templates/V2/Components/Stack/StackComponentViewModel.swift b/RevenueCatUI/Templates/V2/Components/Stack/StackComponentViewModel.swift index 1444c631b8..311ef22663 100644 --- a/RevenueCatUI/Templates/V2/Components/Stack/StackComponentViewModel.swift +++ b/RevenueCatUI/Templates/V2/Components/Stack/StackComponentViewModel.swift @@ -23,8 +23,8 @@ class StackComponentViewModel { private let component: PaywallComponent.StackComponent private let presentedOverrides: PresentedOverrides? - let badgeTextViewModel: TextComponentViewModel? + let badgeTextViewModel: TextComponentViewModel? let viewModels: [PaywallComponentViewModel] init( @@ -151,7 +151,7 @@ struct StackComponentStyle { self.shape = shape?.shape self.border = border?.border self.shadow = shadow?.shadow - self.badge = badge?.badge(parentShape: self.shape) + self.badge = badge?.badge(stackShape: self.shape) } var vstackStrategy: StackStrategy { @@ -235,7 +235,7 @@ private extension PaywallComponent.Shadow { @available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) private extension PaywallComponent.Badge { - func badge(parentShape: ShapeModifier.Shape?) -> BadgeModifier.BadgeInfo? { + func badge(stackShape: ShapeModifier.Shape?) -> BadgeModifier.BadgeInfo? { BadgeModifier.BadgeInfo( style: self.style, alignment: self.alignment, @@ -249,7 +249,7 @@ private extension PaywallComponent.Badge { horizontalAlignment: self.horizontalAlignment, color: self.color, backgroundColor: self.backgroundColor, - parentShape: parentShape + stackShape: stackShape ) } diff --git a/RevenueCatUI/Templates/V2/ViewHelpers/BadgeModifier.swift b/RevenueCatUI/Templates/V2/ViewHelpers/BadgeModifier.swift index 4178cbc55e..518a1f6688 100644 --- a/RevenueCatUI/Templates/V2/ViewHelpers/BadgeModifier.swift +++ b/RevenueCatUI/Templates/V2/ViewHelpers/BadgeModifier.swift @@ -37,7 +37,7 @@ struct BadgeModifier: ViewModifier { let horizontalAlignment: PaywallComponent.HorizontalAlignment let color: PaywallComponent.ColorScheme let backgroundColor: PaywallComponent.ColorScheme - let parentShape: ShapeModifier.Shape? + let stackShape: ShapeModifier.Shape? } func body(content: Content) -> some View { @@ -234,28 +234,28 @@ fileprivate extension View { bottomRight: corners?.bottomRight)) case .topLeading: return .rectangle(.init( - topLeft: radiusInfo(shape: badge.parentShape)?.topLeft, + topLeft: radiusInfo(shape: badge.stackShape)?.topLeft, topRight: 0, bottomLeft: 0, bottomRight: corners?.bottomRight)) case .topTrailing: return .rectangle(.init( topLeft: 0.0, - topRight: radiusInfo(shape: badge.parentShape)?.topRight, + topRight: radiusInfo(shape: badge.stackShape)?.topRight, bottomLeft: corners?.bottomLeft, bottomRight: 0)) case .bottomLeading: return .rectangle(.init( topLeft: 0.0, topRight: corners?.topRight, - bottomLeft: radiusInfo(shape: badge.parentShape)?.bottomLeft, + bottomLeft: radiusInfo(shape: badge.stackShape)?.bottomLeft, bottomRight: 0)) case .bottomTrailing: return .rectangle(.init( topLeft: corners?.topLeft, topRight: 0, bottomLeft: 0, - bottomRight: radiusInfo(shape: badge.parentShape)?.bottomRight)) + bottomRight: radiusInfo(shape: badge.stackShape)?.bottomRight)) } } case .nested, .overlaid: @@ -263,7 +263,7 @@ fileprivate extension View { } } - // Helper to extract the RadiusInfo from a rectable shape + // Helper to extract the RadiusInfo from a rectanle shape private func radiusInfo(shape: ShapeModifier.Shape?) -> ShapeModifier.RadiusInfo? { switch shape { case .rectangle(let radius): @@ -354,7 +354,7 @@ private func badge(style: PaywallComponent.BadgeStyle, alignment: PaywallCompone horizontalAlignment: .center, color: .init(light: .hex("#000000")), backgroundColor: .init(light: .hex("#FA8072")), - parentShape: .rectangle(.init(topLeft: 12.0, topRight: 12, bottomLeft: 12, bottomRight: 12)) + stackShape: .rectangle(.init(topLeft: 12.0, topRight: 12, bottomLeft: 12, bottomRight: 12)) ), // swiftlint:disable:next force_try textComponentViewModel: try! TextComponentViewModel(