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: remove unscrollable spacing in Template 5 #3562

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

NachoSoto
Copy link
Contributor

By @thillsman. See #3561.

Motivation

As I was implementing this template (with longer content that needs scrolling), the spacing cut off the headline in a weird way. It also takes up a small bit of vertical space unnecessarily.

Description

Instead of doing the previous layout: header image / even space / scrollable content / even space / footer, I updated the layout to make the header image and scrollable content in a 0 spacing VStack, with the same existing padding inside the scrollable content to have the same initial layout as before. Probably best described with two videos:

Before:

Screen.Recording.2024-01-08.at.10.10.17.PM.mov

After:

Screen.Recording.2024-01-08.at.10.07.46.PM.mov

### Motivation
As I was implementing this template (with longer content that needs
scrolling), the spacing cut off the headline in a weird way. It also
takes up a small bit of vertical space unnecessarily.

### Description
Instead of doing the previous layout: `header image / even space /
scrollable content / even space / footer`, I updated the layout to make
the header image and scrollable content in a 0 spacing VStack, with the
same existing padding _inside_ the scrollable content to have the same
initial layout as before. Probably best described with two videos:

Before:

https://github.com/RevenueCat/purchases-ios/assets/997637/0961e99c-8a25-4099-a763-6838ff1ac0ed

After:

https://github.com/RevenueCat/purchases-ios/assets/997637/22274ed2-3ab1-4fc1-894b-83cd8013bce8

Let me know if you have any questions! (@joshdholtz told me to just make
a PR, so this is mostly his fault.)
@NachoSoto NachoSoto requested a review from a team January 9, 2024 17:15
@NachoSoto
Copy link
Contributor Author

There's a slight difference in the default top padding, I'll fix it: https://github.com/RevenueCat/purchases-ios-snapshots/pull/111/files

The footer ones do pass.

}
}

private var scrollableContent: some View {
VStack(spacing: self.defaultVerticalPaddingLength) {
if self.configuration.mode.isFullScreen {
Spacer()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to make spacing even now.

@NachoSoto NachoSoto enabled auto-merge (squash) January 9, 2024 21:29
@NachoSoto NachoSoto merged commit a0187d2 into main Jan 9, 2024
23 checks passed
@NachoSoto NachoSoto deleted the paywalls-template-5-top-padding-fix branch January 9, 2024 22:28
NachoSoto pushed a commit that referenced this pull request Jan 10, 2024
**This is an automatic release.**

### RevenueCatUI
* `Paywalls`: remove unscrollable spacing in Template 5 (#3562) via
NachoSoto (@NachoSoto)
* `Paywalls`: improve template 5 checkmark icon (#3559) via NachoSoto
(@NachoSoto)
### Bugfixes
* Improve sandbox detector for macOS apps (#3549) via Mark Villacampa
(@MarkVillacampa)
### Other Changes
* `Paywalls`: new
`PaywallViewControllerDelegate.paywallViewController(_:didChangeSizeTo:)`
(#3563) via Cesar de la Vega (@vegaro)
* `Tests`: running tests on `macOS` (#3533) via NachoSoto (@NachoSoto)
* `Integration Tests`: split into separate jobs (#3560) via NachoSoto
(@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants