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

Better spacing in PromotionalOfferView #4369

Merged
merged 2 commits into from
Oct 11, 2024
Merged
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
21 changes: 16 additions & 5 deletions RevenueCatUI/CustomerCenter/Views/PromotionalOfferView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ struct PromotionalOfferView: View {
))
}

private let horizontalPadding: CGFloat = 20

var body: some View {
ZStack {
if let background = Color.from(colorInformation: appearance.backgroundColor, for: colorScheme) {
Expand All @@ -64,6 +66,7 @@ struct PromotionalOfferView: View {
PromoOfferButtonView(isLoading: $isLoading,
viewModel: self.viewModel,
appearance: self.appearance)
.padding(.horizontal, horizontalPadding)

Button {
dismiss()
Expand Down Expand Up @@ -97,18 +100,26 @@ struct PromotionalOfferHeaderView: View {
@ObservedObject
private(set) var viewModel: PromotionalOfferViewModel

private let spacing: CGFloat = 30
private let topPadding: CGFloat = 150
private let horizontalPadding: CGFloat = 40

var body: some View {
let textColor = Color.from(colorInformation: appearance.textColor, for: colorScheme)
if let details = self.viewModel.promotionalOfferData?.promoOfferDetails {
VStack {
VStack(spacing: spacing) {
Text(details.title)
.font(.title)
.padding()
.fontWeight(.bold)
.multilineTextAlignment(.center)
.padding(.top, topPadding)

Text(details.subtitle)
.font(.title3)
.padding()
}.applyIf(textColor != nil, apply: { $0.foregroundColor(textColor) })
.font(.body)
.multilineTextAlignment(.center)
}
.applyIf(textColor != nil, apply: { $0.foregroundColor(textColor) })
.padding(.horizontal, horizontalPadding)
}
}

Expand Down