|
|
@@ -2,15 +2,14 @@ import SwiftUI
|
|
|
|
|
|
struct SpellCheckerView: View {
|
|
|
@StateObject private var viewModel = SpellCheckerViewModel()
|
|
|
- let onBackTapped: () -> Void
|
|
|
|
|
|
private let panelBackground = Color(red: 0.96, green: 0.97, blue: 0.98)
|
|
|
|
|
|
var body: some View {
|
|
|
GeometryReader { proxy in
|
|
|
let dynamicHorizontalPadding = min(max(proxy.size.width * 0.045, AppTheme.contentPadding), 52)
|
|
|
- let dynamicTopPadding = min(max(proxy.size.height * 0.05, 24), 44)
|
|
|
- let dynamicBottomPadding = min(max(proxy.size.height * 0.06, 28), 56)
|
|
|
+ let dynamicTopPadding = min(max(proxy.size.height * 0.015, 8), 16)
|
|
|
+ let dynamicBottomPadding = min(max(proxy.size.height * 0.04, 20), 40)
|
|
|
let dynamicEditorHeight = min(max(proxy.size.height * 0.43, 260), 560)
|
|
|
|
|
|
Group {
|
|
|
@@ -61,10 +60,12 @@ struct SpellCheckerView: View {
|
|
|
|
|
|
private var header: some View {
|
|
|
VStack(alignment: .leading, spacing: 16) {
|
|
|
- IconButton(iconName: "arrow.left") {
|
|
|
- onBackTapped()
|
|
|
+ if viewModel.hasResults {
|
|
|
+ IconButton(iconName: "arrow.left") {
|
|
|
+ viewModel.resetResults()
|
|
|
+ }
|
|
|
+ .accessibilityLabel("Go back")
|
|
|
}
|
|
|
- .accessibilityLabel("Go back")
|
|
|
|
|
|
HStack(alignment: .top) {
|
|
|
VStack(alignment: .leading, spacing: 8) {
|