-
Notifications
You must be signed in to change notification settings - Fork 339
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] Update Stack to handle property overrides #4476
[Paywalls V2] Update Stack to handle property overrides #4476
Conversation
// Without compositingGroup(), the shadow is applied to the stack's children as well. | ||
view.compositingGroup().shadow(shadow: shadow) | ||
} | ||
.padding(viewModel.margin) | ||
.padding(style.margin) |
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.
how does this interact with line 75? Does it override it?
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.
@vegaro This does look very unclear without context 😅 SwiftUI applies things on top of each other so...
- Line 75 adds padding to the view to make it bigger
- Line 78 adds background color (which is applied to the whole bigger view)
- This line (85) adds
padding
again (but without background color) so it acts as margin
RevenueCatUI/Templates/Components/Stack/StackComponentViewModel.swift
Outdated
Show resolved
Hide resolved
26cd38e
to
f16fa6e
Compare
9fc70a4
to
05ca788
Compare
Motivation
Do what Stack version of #4417
Description
Stacks can now use overrides based on:
Bonus
Implements a new system for handling UI component state overrides based on different
presentation contexts (screen size, selection state, etc).
See #4477 for what this change looks like on when used on a new component (it was super clean when adding it to image)
Key changes:
PresentedPartial
protocol for component combining behavior/propertiesPresentedOverrides<T>
struct to handle:The system follows a hierarchical override pattern where more specific states (like selection) take precedence over more general ones (like screen size). Screen conditions cascade (expanded includes medium + compact overrides).