Add effects to the congratulations screen when personalisation is disabled.

Improve the API of the EffectsView to make it more swifty.
This commit is contained in:
Doug
2022-03-21 17:33:24 +00:00
parent 4f463943b3
commit 48b3326d73
5 changed files with 40 additions and 4 deletions
@@ -54,6 +54,7 @@ struct OnboardingCongratulationsScreen: View {
maxHeight: OnboardingConstants.maxContentHeight)
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
.overlay(effects.ignoresSafeArea())
.background(theme.colors.accent.ignoresSafeArea())
.accentColor(.white)
.navigationBarHidden(true)
@@ -120,6 +121,13 @@ struct OnboardingCongratulationsScreen: View {
.buttonStyle(PrimaryActionButtonStyle(customColor: .white))
.accessibilityIdentifier("homeButton")
}
@ViewBuilder
var effects: some View {
if viewModel.viewState.personalizationDisabled {
EffectsView(effectsType: .confetti)
}
}
}
// MARK: - Previews