create contentview view model
add background to content view make contentview list split by year / month test data will add 120 days instead of 25 closed #35 closed #36
This commit is contained in:
@@ -10,6 +10,8 @@ import SwiftUI
|
||||
struct SettingsView: View {
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
let editedDataClosure: (() -> Void)
|
||||
|
||||
@AppStorage("notificationDate") private var notificationDate = Date() {
|
||||
didSet {
|
||||
if self.showReminder {
|
||||
@@ -94,6 +96,7 @@ struct SettingsView: View {
|
||||
Color(UIColor.systemBackground)
|
||||
Button(action: {
|
||||
PersistenceController.shared.populateTestData()
|
||||
editedDataClosure()
|
||||
}, label: {
|
||||
Text("Add test data")
|
||||
})
|
||||
@@ -108,6 +111,7 @@ struct SettingsView: View {
|
||||
Color(UIColor.systemBackground)
|
||||
Button(action: {
|
||||
PersistenceController.shared.clearDB()
|
||||
editedDataClosure()
|
||||
}, label: {
|
||||
Text("Clear DB")
|
||||
})
|
||||
@@ -195,9 +199,13 @@ struct SettingsView: View {
|
||||
|
||||
struct SettingsView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SettingsView()
|
||||
SettingsView(editedDataClosure: {
|
||||
|
||||
})
|
||||
|
||||
SettingsView()
|
||||
SettingsView(editedDataClosure: {
|
||||
|
||||
})
|
||||
.preferredColorScheme(.dark)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user