-
Notifications
You must be signed in to change notification settings - Fork 54
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] TextComponentView
handles overrides with TextComponentState
#1989
Conversation
…omponentState in TextComponentView.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1989 +/- ##
=======================================
Coverage 81.95% 81.95%
=======================================
Files 260 260
Lines 8507 8507
Branches 1226 1226
=======================================
Hits 6972 6972
Misses 1036 1036
Partials 499 499 ☔ View full report in Codecov by Sentry. |
# Conflicts: # ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/text/TextComponentView.kt # ui/revenuecatui/src/test/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/button/ButtonComponentViewTests.kt
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.
Looks great!
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.
Small thing but should we rename the file name to uppercase? Mostly to follow conventions...
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.
Oh yea I can do that separately as there are a few more. Wasn't sure about the convention as we have errors.kt
as well.
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.
Yeah, I think we should follow conventions and name them uppercased, but not a huge deal yeah.
**This is an automatic release.** ## RevenueCat SDK ### 🐞 Bugfixes * improvements for fr translations (#2019) via Andy Boedo (@aboedo) ### 🔄 Other Changes * Feedback Surveys (#2010) via Cesar de la Vega (@vegaro) * [Paywalls V2] Fixes previews (#2015) via JayShortway (@JayShortway) * [Paywalls V2] Moves validation logic to the Loading phase (#2007) via JayShortway (@JayShortway) * Add Cancel subscriptions support (#2008) via Cesar de la Vega (@vegaro) * [Paywalls V2] Localizations are kept in a NonEmptyMap (#2001) via JayShortway (@JayShortway) * [Paywalls V2] `TextComponentState` handles locale changes (#2000) via JayShortway (@JayShortway) * [Paywalls V2] Some minor cleanup (#1994) via JayShortway (@JayShortway) * [Paywalls V2] `StackComponentView` handles overrides with `StackComponentState` (#1993) via JayShortway (@JayShortway) * Customer Center restores [CC-2] (#1999) via Cesar de la Vega (@vegaro) * [Paywalls V2] Add more image component previews to test parent being smaller than image size (#2004) via Toni Rico (@tonidero) * [Paywalls V2] Add `PurchaseButtonComponent` support (#2002) via Toni Rico (@tonidero) * Build Customer Center from JSON (#1998) via Cesar de la Vega (@vegaro) * Fix missing import after PR merge conflict (#1997) via Toni Rico (@tonidero) * [Paywalls V2] Add `StickyFooterComponentView` (#1991) via Toni Rico (@tonidero) * [Paywalls V2] `TextComponentView` handles overrides with `TextComponentState` (#1989) via JayShortway (@JayShortway) Co-authored-by: revenuecat-ops <[email protected]>
Description
This PR introduces the concept of a
*ComponentState
, starting withTextComponentState
. Its goal is to be able to use Compose's state system to handle all the different override scenarios we have, so as to avoid having to recreate the entire tree of components each time.In order to do so,
TextComponentState
basically has all the properties thatTextComponentStyle
has, except they're backed byState
s that are derived from the override criteria.In follow-up PRs I'll give
StackComponentStyle
the same treatment. This will makeStyleFactory
even simpler, which allows us to move it to thePaywallViewModel
's loading phase.Other changes