Merge pull request 'Add Done button to grammar exercise score screen' (#17) from fix/grammar-exercise-back-button into main
This commit was merged in pull request #17.
This commit is contained in:
@@ -3,6 +3,7 @@ import SwiftUI
|
|||||||
struct GrammarExerciseView: View {
|
struct GrammarExerciseView: View {
|
||||||
let noteId: String
|
let noteId: String
|
||||||
let noteTitle: String
|
let noteTitle: String
|
||||||
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
|
||||||
@State private var exercises: [GrammarExercise] = []
|
@State private var exercises: [GrammarExercise] = []
|
||||||
@State private var currentIndex = 0
|
@State private var currentIndex = 0
|
||||||
@@ -122,6 +123,19 @@ struct GrammarExerciseView: View {
|
|||||||
Text(correctCount == exercises.count ? "Perfect!" : "Keep reviewing this topic.")
|
Text(correctCount == exercises.count ? "Perfect!" : "Keep reviewing this topic.")
|
||||||
.font(.title3)
|
.font(.title3)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
|
|
||||||
|
Button {
|
||||||
|
dismiss()
|
||||||
|
} label: {
|
||||||
|
Text("Done")
|
||||||
|
.font(.headline)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.padding(.vertical, 12)
|
||||||
|
}
|
||||||
|
.buttonStyle(.borderedProminent)
|
||||||
|
.tint(.purple)
|
||||||
|
.padding(.horizontal)
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user