Add push notifications
This commit is contained in:
@ -41,6 +41,9 @@ struct MainView: App {
|
||||
@StateObject
|
||||
private var upload: RemotePush = .init()
|
||||
|
||||
@StateObject
|
||||
private var notifications: NotificationSender = .init()
|
||||
|
||||
@State
|
||||
private var language: ContentLanguage = .english
|
||||
|
||||
@ -68,6 +71,9 @@ struct MainView: App {
|
||||
@State
|
||||
private var showUploadSheet = false
|
||||
|
||||
@State
|
||||
private var showNotificationsSheet = false
|
||||
|
||||
@ViewBuilder
|
||||
var sidebar: some View {
|
||||
switch selection.tab {
|
||||
@ -188,6 +194,11 @@ struct MainView: App {
|
||||
Image(systemSymbol: .squareAndArrowUp)
|
||||
}
|
||||
}
|
||||
ToolbarItem {
|
||||
Button(action: { showNotificationsSheet = true }) {
|
||||
Image(systemSymbol: .bell)
|
||||
}
|
||||
}
|
||||
ToolbarItem {
|
||||
Button(action: saveButtonPressed) {
|
||||
Image(systemSymbol: content.saveState.symbol)
|
||||
@ -235,6 +246,11 @@ struct MainView: App {
|
||||
.environmentObject(content)
|
||||
.environmentObject(upload)
|
||||
}
|
||||
.sheet(isPresented: $showNotificationsSheet) {
|
||||
NotificationSheet()
|
||||
.environmentObject(content)
|
||||
.environmentObject(notifications)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user