metatext-app-ios-iphone-ipad/Views/PreferencesView.swift

39 lines
1.3 KiB
Swift
Raw Normal View History

2020-08-07 03:41:59 +02:00
// Copyright © 2020 Metabolist. All rights reserved.
import SwiftUI
2020-09-01 09:33:49 +02:00
import ViewModels
2020-08-07 03:41:59 +02:00
2020-08-07 12:59:48 +02:00
struct PreferencesView: View {
@StateObject var viewModel: PreferencesViewModel
2020-09-08 04:12:38 +02:00
@EnvironmentObject var identification: Identification
2020-08-07 12:59:48 +02:00
2020-08-07 03:41:59 +02:00
var body: some View {
2020-08-07 12:14:14 +02:00
Form {
2020-08-07 12:59:48 +02:00
Section(header: Text(viewModel.handle)) {
NavigationLink("preferences.posting-reading",
destination: PostingReadingPreferencesView(
2020-09-08 04:12:38 +02:00
viewModel: .init(identification: identification)))
2020-08-29 12:26:26 +02:00
NavigationLink("preferences.filters",
destination: FiltersView(
2020-09-08 04:12:38 +02:00
viewModel: .init(identification: identification)))
if viewModel.shouldShowNotificationTypePreferences {
NavigationLink("preferences.notification-types",
destination: NotificationTypesPreferencesView(
2020-09-08 04:12:38 +02:00
viewModel: .init(identification: identification)))
}
2020-08-07 12:14:14 +02:00
}
}
2020-08-07 12:59:48 +02:00
.navigationTitle("preferences")
2020-08-07 03:41:59 +02:00
}
}
2020-08-12 09:37:14 +02:00
#if DEBUG
2020-09-01 09:33:49 +02:00
import PreviewViewModels
2020-08-07 03:41:59 +02:00
struct PreferencesView_Previews: PreviewProvider {
static var previews: some View {
2020-09-08 04:12:38 +02:00
PreferencesView(viewModel: .init(identification: .preview))
2020-08-07 03:41:59 +02:00
}
}
2020-08-12 09:37:14 +02:00
#endif