Remove unnecessary Boxes

Change-Id: Ia404cde7f6b555234bef4b27058fabd4471ea3c6
pull/1220/head
Don Turner 10 months ago
parent 27fd4e544a
commit db5e2b649e

@ -507,23 +507,21 @@ fun ForYouScreenPopulatedFeed(
@PreviewParameter(UserNewsResourcePreviewParameterProvider::class) @PreviewParameter(UserNewsResourcePreviewParameterProvider::class)
userNewsResources: List<UserNewsResource>, userNewsResources: List<UserNewsResource>,
) { ) {
Box { NiaTheme {
NiaTheme { ForYouScreen(
ForYouScreen( isSyncing = false,
isSyncing = false, onboardingUiState = OnboardingUiState.NotShown,
onboardingUiState = OnboardingUiState.NotShown, feedState = NewsFeedUiState.Success(
feedState = NewsFeedUiState.Success( feed = userNewsResources,
feed = userNewsResources, ),
), deepLinkedUserNewsResource = null,
deepLinkedUserNewsResource = null, onTopicCheckedChanged = { _, _ -> },
onTopicCheckedChanged = { _, _ -> }, saveFollowedTopics = {},
saveFollowedTopics = {}, onNewsResourcesCheckedChanged = { _, _ -> },
onNewsResourcesCheckedChanged = { _, _ -> }, onNewsResourceViewed = {},
onNewsResourceViewed = {}, onTopicClick = {},
onTopicClick = {}, onDeepLinkOpened = {},
onDeepLinkOpened = {}, )
)
}
} }
} }
@ -533,23 +531,21 @@ fun ForYouScreenOfflinePopulatedFeed(
@PreviewParameter(UserNewsResourcePreviewParameterProvider::class) @PreviewParameter(UserNewsResourcePreviewParameterProvider::class)
userNewsResources: List<UserNewsResource>, userNewsResources: List<UserNewsResource>,
) { ) {
Box { NiaTheme {
NiaTheme { ForYouScreen(
ForYouScreen( isSyncing = false,
isSyncing = false, onboardingUiState = OnboardingUiState.NotShown,
onboardingUiState = OnboardingUiState.NotShown, feedState = NewsFeedUiState.Success(
feedState = NewsFeedUiState.Success( feed = userNewsResources,
feed = userNewsResources, ),
), deepLinkedUserNewsResource = null,
deepLinkedUserNewsResource = null, onTopicCheckedChanged = { _, _ -> },
onTopicCheckedChanged = { _, _ -> }, saveFollowedTopics = {},
saveFollowedTopics = {}, onNewsResourcesCheckedChanged = { _, _ -> },
onNewsResourcesCheckedChanged = { _, _ -> }, onNewsResourceViewed = {},
onNewsResourceViewed = {}, onTopicClick = {},
onTopicClick = {}, onDeepLinkOpened = {},
onDeepLinkOpened = {}, )
)
}
} }
} }
@ -559,47 +555,43 @@ fun ForYouScreenTopicSelection(
@PreviewParameter(UserNewsResourcePreviewParameterProvider::class) @PreviewParameter(UserNewsResourcePreviewParameterProvider::class)
userNewsResources: List<UserNewsResource>, userNewsResources: List<UserNewsResource>,
) { ) {
Box { NiaTheme {
NiaTheme { ForYouScreen(
ForYouScreen( isSyncing = false,
isSyncing = false, onboardingUiState = OnboardingUiState.Shown(
onboardingUiState = OnboardingUiState.Shown( topics = userNewsResources.flatMap { news -> news.followableTopics }
topics = userNewsResources.flatMap { news -> news.followableTopics } .distinctBy { it.topic.id },
.distinctBy { it.topic.id }, ),
), feedState = NewsFeedUiState.Success(
feedState = NewsFeedUiState.Success( feed = userNewsResources,
feed = userNewsResources, ),
), deepLinkedUserNewsResource = null,
deepLinkedUserNewsResource = null, onTopicCheckedChanged = { _, _ -> },
onTopicCheckedChanged = { _, _ -> }, saveFollowedTopics = {},
saveFollowedTopics = {}, onNewsResourcesCheckedChanged = { _, _ -> },
onNewsResourcesCheckedChanged = { _, _ -> }, onNewsResourceViewed = {},
onNewsResourceViewed = {}, onTopicClick = {},
onTopicClick = {}, onDeepLinkOpened = {},
onDeepLinkOpened = {}, )
)
}
} }
} }
@DevicePreviews @DevicePreviews
@Composable @Composable
fun ForYouScreenLoading() { fun ForYouScreenLoading() {
Box { NiaTheme {
NiaTheme { ForYouScreen(
ForYouScreen( isSyncing = false,
isSyncing = false, onboardingUiState = OnboardingUiState.Loading,
onboardingUiState = OnboardingUiState.Loading, feedState = NewsFeedUiState.Loading,
feedState = NewsFeedUiState.Loading, deepLinkedUserNewsResource = null,
deepLinkedUserNewsResource = null, onTopicCheckedChanged = { _, _ -> },
onTopicCheckedChanged = { _, _ -> }, saveFollowedTopics = {},
saveFollowedTopics = {}, onNewsResourcesCheckedChanged = { _, _ -> },
onNewsResourcesCheckedChanged = { _, _ -> }, onNewsResourceViewed = {},
onNewsResourceViewed = {}, onTopicClick = {},
onTopicClick = {}, onDeepLinkOpened = {},
onDeepLinkOpened = {}, )
)
}
} }
} }
@ -609,22 +601,20 @@ fun ForYouScreenPopulatedAndLoading(
@PreviewParameter(UserNewsResourcePreviewParameterProvider::class) @PreviewParameter(UserNewsResourcePreviewParameterProvider::class)
userNewsResources: List<UserNewsResource>, userNewsResources: List<UserNewsResource>,
) { ) {
Box { NiaTheme {
NiaTheme { ForYouScreen(
ForYouScreen( isSyncing = true,
isSyncing = true, onboardingUiState = OnboardingUiState.Loading,
onboardingUiState = OnboardingUiState.Loading, feedState = NewsFeedUiState.Success(
feedState = NewsFeedUiState.Success( feed = userNewsResources,
feed = userNewsResources, ),
), deepLinkedUserNewsResource = null,
deepLinkedUserNewsResource = null, onTopicCheckedChanged = { _, _ -> },
onTopicCheckedChanged = { _, _ -> }, saveFollowedTopics = {},
saveFollowedTopics = {}, onNewsResourcesCheckedChanged = { _, _ -> },
onNewsResourcesCheckedChanged = { _, _ -> }, onNewsResourceViewed = {},
onNewsResourceViewed = {}, onTopicClick = {},
onTopicClick = {}, onDeepLinkOpened = {},
onDeepLinkOpened = {}, )
)
}
} }
} }

Loading…
Cancel
Save