Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Paywalls V2] Support custom fonts with UIConfig #4631

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 4 additions & 40 deletions RevenueCat.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ fileprivate extension ButtonComponentViewModel {
let stackViewModel = try factory.toStackViewModel(
component: component.stack,
localizationProvider: localizationProvider,
uiConfigProvider: .init(uiConfig: PreviewUIConfig.make()),
offering: offering
)

Expand Down
4 changes: 0 additions & 4 deletions RevenueCatUI/Templates/V2/Components/ComponentsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ struct ComponentsView: View {
TextComponentView(viewModel: viewModel)
case .image(let viewModel):
ImageComponentView(viewModel: viewModel)
case .spacer(let viewModel):
SpacerComponentView(viewModel: viewModel)
case .stack(let viewModel):
StackComponentView(viewModel: viewModel, onDismiss: onDismiss)
case .linkButton(let viewModel):
LinkButtonComponentView(viewModel: viewModel)
case .button(let viewModel):
ButtonComponentView(viewModel: viewModel, onDismiss: onDismiss)
case .package(let viewModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ struct ImageComponentView_Previews: PreviewProvider {
locale: Locale.current,
localizedStrings: [:]
),
uiConfigProvider: .init(uiConfig: PreviewUIConfig.make()),
component: .init(
source: .init(
light: .init(
Expand Down Expand Up @@ -145,6 +146,7 @@ struct ImageComponentView_Previews: PreviewProvider {
locale: Locale.current,
localizedStrings: [:]
),
uiConfigProvider: .init(uiConfig: PreviewUIConfig.make()),
component: .init(
source: .init(
light: .init(
Expand Down Expand Up @@ -173,6 +175,7 @@ struct ImageComponentView_Previews: PreviewProvider {
locale: Locale.current,
localizedStrings: [:]
),
uiConfigProvider: .init(uiConfig: PreviewUIConfig.make()),
component: .init(
source: .init(
light: .init(
Expand Down Expand Up @@ -204,6 +207,7 @@ struct ImageComponentView_Previews: PreviewProvider {
locale: Locale.current,
localizedStrings: [:]
),
uiConfigProvider: .init(uiConfig: PreviewUIConfig.make()),
component: .init(
source: .init(
light: .init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ class ImageComponentViewModel {
private var introOfferEligibilityContext: IntroOfferEligibilityContext

private let localizationProvider: LocalizationProvider
private let uiConfigProvider: UIConfigProvider
private let component: PaywallComponent.ImageComponent

private let imageInfo: PaywallComponent.ThemeImageUrls
private let presentedOverrides: PresentedOverrides<LocalizedImagePartial>?

init(localizationProvider: LocalizationProvider, component: PaywallComponent.ImageComponent) throws {
init(
localizationProvider: LocalizationProvider,
uiConfigProvider: UIConfigProvider,
component: PaywallComponent.ImageComponent
) throws {
self.localizationProvider = localizationProvider
self.uiConfigProvider = uiConfigProvider
self.component = component

if let overrideSourceLid = component.overrideSourceLid {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ fileprivate extension PackageComponentViewModel {
let stackViewModel = try factory.toStackViewModel(
component: component.stack,
localizationProvider: localizationProvider,
uiConfigProvider: .init(uiConfig: PreviewUIConfig.make()),
offering: offering
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ fileprivate extension PurchaseButtonComponentViewModel {
let stackViewModel = try factory.toStackViewModel(
component: component.stack,
localizationProvider: localizationProvider,
uiConfigProvider: .init(uiConfig: PreviewUIConfig.make()),
offering: offering
)

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ fileprivate extension StackComponentViewModel {
component: component,
packageValidator: validator,
offering: offering,
localizationProvider: localizationProvider
localizationProvider: localizationProvider,
uiConfigProvider: .init(uiConfig: PreviewUIConfig.make())
)
}

Expand Down
Loading