-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add preview for default data #1292
Add preview for default data #1292
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## paywalls #1292 +/- ##
=========================================
Coverage 85.46% 85.46%
=========================================
Files 190 190
Lines 6385 6385
Branches 930 930
=========================================
Hits 5457 5457
Misses 568 568
Partials 360 360 ☔ View full report in Codecov by Sentry. |
modifier = modifier, | ||
contentScale = ContentScale.Crop, | ||
) | ||
if (LocalInspectionMode.current) { |
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.
Should we reuse the isInPreviewMode
composable? We might want to extract it to another file for that.
ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/InternalPaywallView.kt
Outdated
Show resolved
Hide resolved
|
||
@Composable | ||
@ReadOnlyComposable | ||
internal fun isInPreviewMode() = LocalInspectionMode.current |
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.
Can this be a lazy constant, so we don't evaluate it multiple times?
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.
Hmm I'm not sure you can declare a constant and mark it as @Composable
, which is needed to use LocalInspectionMode.current
. In any case, this composable shouldn't be recomputed unless the local composition value changes thanks to @ReadOnlyComposable
.
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.
Oooh nice gotcha
A bit hacky but this way we can see the preview of the default data