2020-08-14 23:41:55 +02:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
|
|
|
|
import SwiftUI
|
2020-09-01 09:33:49 +02:00
|
|
|
import ViewModels
|
2020-08-14 23:41:55 +02:00
|
|
|
|
|
|
|
struct NotificationTypesPreferencesView: View {
|
|
|
|
@StateObject var viewModel: NotificationTypesPreferencesViewModel
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
Form {
|
|
|
|
Toggle("preferences.notification-types.follow",
|
|
|
|
isOn: $viewModel.pushSubscriptionAlerts.follow)
|
|
|
|
Toggle("preferences.notification-types.favourite",
|
|
|
|
isOn: $viewModel.pushSubscriptionAlerts.favourite)
|
|
|
|
Toggle("preferences.notification-types.reblog",
|
|
|
|
isOn: $viewModel.pushSubscriptionAlerts.reblog)
|
|
|
|
Toggle("preferences.notification-types.mention",
|
|
|
|
isOn: $viewModel.pushSubscriptionAlerts.mention)
|
2021-01-29 04:15:06 +01:00
|
|
|
Toggle("preferences.notification-types.follow-request",
|
|
|
|
isOn: $viewModel.pushSubscriptionAlerts.followRequest)
|
2020-08-14 23:41:55 +02:00
|
|
|
Toggle("preferences.notification-types.poll",
|
|
|
|
isOn: $viewModel.pushSubscriptionAlerts.poll)
|
2021-01-29 02:57:17 +01:00
|
|
|
Toggle("preferences.notification-types.status",
|
|
|
|
isOn: $viewModel.pushSubscriptionAlerts.status)
|
2020-08-14 23:41:55 +02:00
|
|
|
}
|
|
|
|
.navigationTitle("preferences.notification-types")
|
|
|
|
.alertItem($viewModel.alertItem)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if DEBUG
|
2020-09-01 09:33:49 +02:00
|
|
|
import PreviewViewModels
|
|
|
|
|
2020-08-14 23:41:55 +02:00
|
|
|
struct NotificationTypesPreferencesView_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
2021-01-26 01:06:35 +01:00
|
|
|
NotificationTypesPreferencesView(viewModel: .init(identityContext: .preview))
|
2020-08-14 23:41:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|