Skip to content

Commit

Permalink
Updated super outdated properties on image
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdholtz committed Jan 13, 2025
1 parent 652aa67 commit b3e2f26
Showing 1 changed file with 42 additions and 8 deletions.
50 changes: 42 additions & 8 deletions Sources/Paywalls/Components/PaywallImageComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ import Foundation

#if PAYWALL_COMPONENTS

//source: ImageScheme | None = None
//override_source_lid: LocalizationId | None = None
//color_overlay: ColorSchemes | None = None
//fit_mode: FitMode | None = None
//mask_shape: MaskShape | None = None
//size: Size | None = None
//padding: Spacing | None = None
//margin: Spacing | None = None
//border: Border | None = None
//shadow: Shadow | None = None

public extension PaywallComponent {

struct ImageComponent: PaywallComponentBase {
Expand All @@ -18,9 +29,13 @@ public extension PaywallComponent {
public let source: ThemeImageUrls
public let size: Size
public let overrideSourceLid: LocalizationKey?
public let maskShape: MaskShape?
public let gradientColors: [ColorHex]?
public let fitMode: FitMode
public let maskShape: MaskShape?
public let colorOverlay: ColorScheme?
public let padding: Padding?
public let margin: Padding?
public let border: Border?
public let shadow: Shadow?

public let overrides: ComponentOverrides<PartialImageComponent>?

Expand All @@ -29,9 +44,12 @@ public extension PaywallComponent {
size: Size = .init(width: .fill, height: .fit),
overrideSourceLid: LocalizationKey? = nil,
fitMode: FitMode = .fit,
maxHeight: CGFloat? = nil,
maskShape: MaskShape? = nil,
gradientColors: [ColorHex]? = [],
colorOverlay: ColorScheme? = nil,
padding: Padding? = nil,
margin: Padding? = nil,
border: Border? = nil,
shadow: Shadow? = nil,
overrides: ComponentOverrides<PartialImageComponent>? = nil
) {
self.type = .image
Expand All @@ -40,7 +58,11 @@ public extension PaywallComponent {
self.overrideSourceLid = overrideSourceLid
self.fitMode = fitMode
self.maskShape = maskShape
self.gradientColors = gradientColors
self.colorOverlay = colorOverlay
self.padding = padding
self.margin = margin
self.border = border
self.shadow = shadow
self.overrides = overrides
}

Expand All @@ -53,8 +75,12 @@ public extension PaywallComponent {
public let size: Size?
public let overrideSourceLid: LocalizationKey?
public let maskShape: MaskShape?
public let gradientColors: [ColorHex]?
public let fitMode: FitMode?
public let colorOverlay: ColorScheme?
public let padding: Padding?
public let margin: Padding?
public let border: Border?
public let shadow: Shadow?

public init(
visible: Bool? = true,
Expand All @@ -63,15 +89,23 @@ public extension PaywallComponent {
overrideSourceLid: LocalizationKey? = nil,
fitMode: FitMode? = nil,
maskShape: MaskShape? = nil,
gradientColors: [ColorHex]? = nil
colorOverlay: ColorScheme? = nil,
padding: Padding? = nil,
margin: Padding? = nil,
border: Border? = nil,
shadow: Shadow? = nil
) {
self.visible = visible
self.source = source
self.size = size
self.overrideSourceLid = overrideSourceLid
self.fitMode = fitMode
self.maskShape = maskShape
self.gradientColors = gradientColors
self.colorOverlay = colorOverlay
self.padding = padding
self.margin = margin
self.border = border
self.shadow = shadow
}

}
Expand Down

0 comments on commit b3e2f26

Please sign in to comment.