Updates following PR review.

Fix tests by moving constants out of Coordinator (as it is only part of the Riot target).
This commit is contained in:
Doug
2022-01-27 14:44:10 +00:00
parent 229ce51691
commit 7deb71810d
14 changed files with 110 additions and 50 deletions
@@ -70,7 +70,7 @@ struct OnboardingSplashScreen: View {
buttons
.padding(.horizontal, 16)
.frame(maxWidth: OnboardingCoordinator.maxContentWidth)
.frame(maxWidth: OnboardingConstants.maxContentWidth)
Spacer()
}
.background(ViewFrameReader(frame: $overlayFrame))
@@ -195,6 +195,5 @@ struct OnboardingSplashScreen_Previews: PreviewProvider {
static let stateRenderer = MockOnboardingSplashScreenScreenState.stateRenderer
static var previews: some View {
stateRenderer.screenGroup()
// .environment(\.layoutDirection, .rightToLeft)
}
}
@@ -30,15 +30,11 @@ struct OnboardingSplashScreenPage: View {
/// The height of the non-scrollable content in the splash screen.
let overlayHeight: CGFloat
var isDarkModeEnabled: Bool {
theme.identifier != .light
}
// MARK: - Views
@ViewBuilder
var backgroundGradient: some View {
if !isDarkModeEnabled {
if !theme.isDark {
LinearGradient(gradient: content.gradient, startPoint: .leading, endPoint: .trailing)
.flipsForRightToLeftLayoutDirection(true)
}
@@ -47,7 +43,7 @@ struct OnboardingSplashScreenPage: View {
var body: some View {
VStack {
VStack {
Image(isDarkModeEnabled ? content.darkImage.name : content.image.name)
Image(theme.isDark ? content.darkImage.name : content.image.name)
.resizable()
.scaledToFit()
.frame(maxWidth: 300)
@@ -70,8 +66,8 @@ struct OnboardingSplashScreenPage: View {
Spacer().frame(maxHeight: overlayHeight)
}
.padding(.horizontal, 16)
.frame(maxWidth: OnboardingCoordinator.maxContentWidth,
maxHeight: OnboardingCoordinator.maxContentHeight)
.frame(maxWidth: OnboardingConstants.maxContentWidth,
maxHeight: OnboardingConstants.maxContentHeight)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(backgroundGradient.ignoresSafeArea())