New notifications section in settings (#1273)

This commit is contained in:
Nicolas Mauri
2023-07-10 19:26:49 +02:00
committed by GitHub
parent 2cec1858ff
commit 5ae227179c
26 changed files with 639 additions and 14 deletions
@@ -113,6 +113,15 @@ struct SettingsScreen: View {
context.send(viewAction: .changedTimelineStyle)
}
// Notifications
if context.viewState.showNotificationSettings {
Button { context.send(viewAction: .notifications) } label: {
Label(L10n.screenNotificationSettingsTitle, systemImage: "bell")
}
.buttonStyle(.compoundForm(accessory: .navigationLink))
.accessibilityIdentifier("notificationsButton")
}
// Analytics
Button { context.send(viewAction: .analytics) } label: {
Label(L10n.commonAnalytics, systemImage: "chart.bar")
@@ -194,6 +203,7 @@ struct SettingsScreen_Previews: PreviewProvider {
static let viewModel = {
let userSession = MockUserSession(clientProxy: MockClientProxy(userID: "@userid:example.com"),
mediaProvider: MockMediaProvider())
ServiceLocator.shared.settings.notificationSettingsEnabled = true
return SettingsScreenViewModel(userSession: userSession,
appSettings: ServiceLocator.shared.settings)
}()