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: markdown support #2961

Merged
merged 1 commit into from
Aug 3, 2023
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
12 changes: 6 additions & 6 deletions RevenueCatUI/Data/TestData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ internal enum TestData {
termsOfServiceURL: URL(string: "https://revenuecat.com/tos")!
),
localization: .init(
title: "How your free trial works",
title: "How your **free** trial works",
callToAction: "Start",
callToActionWithIntroOffer: "Start your {{ intro_duration }} free",
offerDetails: "Only {{ price }} per {{ period }}",
offerDetailsWithIntroOffer: "First {{ intro_duration }} free,\nthen {{ total_price_and_per_month }}",
features: [
.init(title: "Today",
content: "Full access to 1000+ workouts plus free meal plan worth {{ price }}.",
content: "Full access to 1000+ workouts plus _free_ meal plan worth {{ price }}.",
iconID: "tick"),
.init(title: "Day 7",
content: "Get a reminder about when your trial is about to end.",
Expand Down Expand Up @@ -313,17 +313,17 @@ internal enum TestData {
}()

static let localization1: PaywallData.LocalizedConfiguration = .init(
title: "Ignite your child's curiosity",
subtitle: "Get access to all our educational content trusted by thousands of parents.",
title: "Ignite your child's *curiosity*",
subtitle: "Get access to all our educational content trusted by **thousands** of parents.",
callToAction: "Purchase for {{ price }}",
callToActionWithIntroOffer: "Purchase for {{ price_per_month }} per month",
offerDetails: "{{ price_per_month }} per month",
offerDetailsWithIntroOffer: "Start your {{ intro_duration }} trial, then {{ price_per_month }} per month",
features: []
)
static let localization2: PaywallData.LocalizedConfiguration = .init(
title: "Call to action for better conversion.",
subtitle: "Lorem ipsum is simply dummy text of the printing and typesetting industry.",
title: "Call to action for _better_ conversion.",
subtitle: "Lorem ipsum is simply dummy text of the ~printing and~ typesetting industry.",
callToAction: "Subscribe for {{ price_per_month }}/mo",
offerDetails: "{{ total_price_and_per_month }}",
offerDetailsWithIntroOffer: "{{ total_price_and_per_month }} after {{ intro_duration }} trial",
Expand Down
4 changes: 2 additions & 2 deletions RevenueCatUI/Templates/MultiPackageBoldTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ struct MultiPackageBoldTemplate: TemplateViewType {

Spacer()

Text(self.selectedLocalization.title)
Text(.init(self.selectedLocalization.title))
.foregroundColor(self.configuration.colors.text1Color)
.font(.largeTitle.bold())

Spacer()

Text(self.selectedLocalization.subtitle ?? "")
Text(.init(self.selectedLocalization.subtitle ?? ""))
.foregroundColor(self.configuration.colors.text1Color)
.font(.title3)

Expand Down
4 changes: 2 additions & 2 deletions RevenueCatUI/Templates/OnePackageStandardTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct OnePackageStandardTemplate: TemplateViewType {
self.headerImage

Group {
Text(verbatim: self.localization.title)
Text(.init(self.localization.title))
.font(self.configuration.mode.titleFont)
.fontWeight(.heavy)
.padding(
Expand All @@ -65,7 +65,7 @@ struct OnePackageStandardTemplate: TemplateViewType {
)

if self.configuration.mode.displaySubtitle, let subtitle = self.localization.subtitle {
Text(verbatim: subtitle)
Text(.init(subtitle))
.font(self.configuration.mode.subtitleFont)
}
}
Expand Down
6 changes: 3 additions & 3 deletions RevenueCatUI/Templates/OnePackageWithFeaturesTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct OnePackageWithFeaturesTemplate: TemplateViewType {
.cornerRadius(8)
}

Text(self.localization.title)
Text(.init(self.localization.title))
.font(.title)
.foregroundStyle(self.configuration.colors.text1Color)
.multilineTextAlignment(.center)
Expand Down Expand Up @@ -145,14 +145,14 @@ private struct FeatureView: View {
self.icon
}

Text(self.feature.title)
Text(.init(self.feature.title))
.foregroundStyle(self.colors.text1Color)
.font(.headline)
.frame(maxWidth: .infinity, alignment: .leading)
}

if let content = self.feature.content {
Text(content)
Text(.init(content))
.foregroundStyle(self.colors.accent2Color)
.font(.body)
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.