metatext/Shared/Views/PreferencesView.swift

32 lines
1 KiB
Swift
Raw Normal View History

2020-08-07 01:41:59 +00:00
// Copyright © 2020 Metabolist. All rights reserved.
import SwiftUI
2020-08-07 10:59:48 +00:00
struct PreferencesView: View {
@StateObject var viewModel: PreferencesViewModel
2020-08-07 01:41:59 +00:00
var body: some View {
2020-08-07 10:14:14 +00:00
Form {
2020-08-07 10:59:48 +00:00
Section(header: Text(viewModel.handle)) {
NavigationLink("preferences.posting-reading",
destination: PostingReadingPreferencesView(
viewModel: viewModel.postingReadingPreferencesViewModel()))
if viewModel.shouldShowNotificationTypePreferences {
NavigationLink("preferences.notification-types",
destination: NotificationTypesPreferencesView(
viewModel: viewModel.notificationTypesPreferencesViewModel()))
}
2020-08-07 10:14:14 +00:00
}
}
2020-08-07 10:59:48 +00:00
.navigationTitle("preferences")
2020-08-07 01:41:59 +00:00
}
}
2020-08-12 07:37:14 +00:00
#if DEBUG
2020-08-07 01:41:59 +00:00
struct PreferencesView_Previews: PreviewProvider {
static var previews: some View {
2020-08-07 10:59:48 +00:00
PreferencesView(viewModel: .development)
2020-08-07 01:41:59 +00:00
}
}
2020-08-12 07:37:14 +00:00
#endif