Repository: Automattic/pocket-casts-android
File: modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/onboarding/upgrade/OnboardingUpgradeScreen.kt (Kotlin)

Code before:
    onCtaClicked: () -> Unit,
) {
    LazyColumn {
        items(features.features.size) {
            UpgradeFeatureItem(
                item = features.features[it],
                iconColor = MaterialTheme.theme.colors.primaryText01,
                textColor = MaterialTheme.theme.colors.secondaryText02,
            )
        }
        if (features.showCta) {
            item {
                Spacer(modifier = Modifier.height(24.dp))
                TextP40(
                    text = stringResource(LR.string.onboarding_upgrade_features_trial_schedule),
                    modifier = Modifier.clickable { onCtaClicked() },
                    color = MaterialTheme.theme.colors.primaryInteractive01,
                )
            }
        }
    }
}

@Composable
private fun ScheduleContent(
    trialSchedule: ContentPage.TrialSchedule,
    onCtaClicked: () -> Unit,
) {
    LazyColumn {
        item {
            UpgradeTrialTimeline(
                items = trialSchedule.timelineItems,
            )
        }
        if (trialSchedule.showCta) {
            item {
                Spacer(modifier = Modifier.height(24.dp))
                TextP40(
                    text = stringResource(LR.string.onboarding_upgrade_schedule_see_features),
                    modifier = Modifier.clickable { onCtaClicked() },
                    color = MaterialTheme.theme.colors.primaryInteractive01,
                )
            }
        }
    }
}

@Preview
@Composable
private fun PreviewOnboardingUpgradeScreen(
    @PreviewParameter(ThemePreviewParameterProvider::class) theme: ThemeType,

Review comment (suggestion):
This should to be wrapped in `Column`, split into separate items, or changed into top padding of the `TextP40`.

Code after:

                is UpgradePagerContent.TrialSchedule -> ScheduleContent(
                    trialSchedule = currentPage,
                    onCtaClick = { coroutineScope.launch { pagerState.animateScrollToPage(pages.size - page) } },
                )
            }
        }
    }
}

@Composable
private fun FeaturesContent(
    features: UpgradePagerContent.Features,
    onCtaClick: () -> Unit,
) {
    FadedLazyColumn {
        items(features.features.size) {
            UpgradeFeatureItem(
                item = features.features[it],
                iconColor = MaterialTheme.theme.colors.primaryText01,
                textColor = MaterialTheme.theme.colors.secondaryText02,
            )
        }
        if (features.showCta) {
            item {
                TextP40(
                    text = stringResource(LR.string.onboarding_upgrade_features_trial_schedule),
                    modifier = Modifier.padding(top = 24.dp)
                        .clickable { onCtaClick() },
                    color = MaterialTheme.theme.colors.primaryInteractive01,
                )
            }
        }
    }
}

@Composable
private fun ScheduleContent(
    trialSchedule: UpgradePagerContent.TrialSchedule,
    onCtaClick: () -> Unit,
) {
    FadedLazyColumn {
        item {
            UpgradeTrialTimeline(
                items = trialSchedule.timelineItems,
            )
        }
        if (trialSchedule.showCta) {
            item {
                TextP40(
                    text = stringResource(LR.string.onboarding_upgrade_schedule_see_features),