-
Notifications
You must be signed in to change notification settings - Fork 329
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] Allow overriding of font size on paywall #4651
base: main
Are you sure you want to change the base?
Conversation
cb94a09
to
5c70b03
Compare
0254a82
to
de08a5f
Compare
…eoretically this should work
de08a5f
to
f5f4ed8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good! I'm just a little afraid we're backing ourselves into a corner here.
case .headingXXL: fontSize = fontSizeOverrides?.headingXXL.asCGFloat ?? 40 | ||
case .headingXL: fontSize = fontSizeOverrides?.headingXL.asCGFloat ?? 34 | ||
case .headingL: fontSize = fontSizeOverrides?.headingL.asCGFloat ?? 28 | ||
case .headingM: fontSize = fontSizeOverrides?.headingM.asCGFloat ?? 24 | ||
case .headingS: fontSize = fontSizeOverrides?.headingS.asCGFloat ?? 20 | ||
case .headingXS: fontSize = fontSizeOverrides?.headingXS.asCGFloat ?? 16 | ||
case .bodyXL: fontSize = fontSizeOverrides?.bodyXL.asCGFloat ?? 18 | ||
case .bodyL: fontSize = fontSizeOverrides?.bodyL.asCGFloat ?? 17 | ||
case .bodyM: fontSize = fontSizeOverrides?.bodyM.asCGFloat ?? 15 | ||
case .bodyS: fontSize = fontSizeOverrides?.bodyS.asCGFloat ?? 13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still like to discuss the backend just sending the font size as a number (e.g. 40
instead of heading_xxl
) in the text
component.
{
- "font_size": "heading_xxl",
+ "font_size": 40,
"type": "text"
}
The dashboard can still have font size names of course. The SDK just doesn't need to know about them.
Benefits I see:
- avoids the complexity added in this PR
- allows us to make changes to the list of font size names without needing SDK updates
- allows us to fine-tune font sizes (even between platforms) without needing SDK updates
I've added an item to our weekly today 😇
Motivation
Allow overriding of font sizes per paywall
Description
New
fontSizeOverride
onPaywallComopnentsData
base
paywall is onheading_xxl
,heading_xl
,body_l
, etc)