Update following review.

This commit is contained in:
Doug
2022-01-28 14:16:06 +00:00
committed by Doug
parent 93e3c3637f
commit 8a4eb6751f
3 changed files with 30 additions and 36 deletions

View File

@@ -34,6 +34,26 @@ struct TemplateSimpleScreen: View {
@ObservedObject var viewModel: TemplateSimpleScreenViewModel.Context
// MARK: Views
var body: some View {
GeometryReader { geometry in
VStack {
ScrollView(showsIndicators: false) {
mainContent
.padding(.top, 50)
.padding(.horizontal, horizontalPadding)
}
buttons
.padding(.horizontal, horizontalPadding)
.padding(.bottom, geometry.safeAreaInsets.bottom > 0 ? 0 : 16)
}
}
.background(theme.colors.background.ignoresSafeArea())
.accentColor(theme.colors.accent)
}
/// The main content of the view to be shown in a scroll view.
var mainContent: some View {
VStack(spacing: 36) {
@@ -42,7 +62,7 @@ struct TemplateSimpleScreen: View {
.foregroundColor(theme.colors.primaryContent)
.accessibilityIdentifier("title")
Image(systemName: viewModel.viewState.promptType.imageName)
Image(viewModel.viewState.promptType.image.name)
.resizable()
.scaledToFit()
.frame(width:100)
@@ -80,24 +100,6 @@ struct TemplateSimpleScreen: View {
}
}
}
var body: some View {
GeometryReader { geometry in
VStack {
ScrollView(showsIndicators: false) {
mainContent
.padding(.top, 50)
.padding(.horizontal, horizontalPadding)
}
buttons
.padding(.horizontal, horizontalPadding)
.padding(.bottom, geometry.safeAreaInsets.bottom > 0 ? 0 : 16)
}
}
.background(theme.colors.background.ignoresSafeArea())
.accentColor(theme.colors.accent)
}
}
// MARK: - Previews