mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-16 17:55:13 +00:00
Remove some Env Object from NotificationRowView
This commit is contained in:
parent
d958d10036
commit
f544d65862
2 changed files with 5 additions and 10 deletions
|
@ -7,13 +7,13 @@ import SwiftUI
|
|||
import Network
|
||||
|
||||
struct NotificationRowView: View {
|
||||
@EnvironmentObject private var client: Client
|
||||
@EnvironmentObject private var currentAccount: CurrentAccount
|
||||
@EnvironmentObject private var theme: Theme
|
||||
@EnvironmentObject private var routerPath: RouterPath
|
||||
@Environment(\.redactionReasons) private var reasons
|
||||
|
||||
let notification: ConsolidatedNotification
|
||||
let client: Client
|
||||
let routerPath: RouterPath
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .top, spacing: 8) {
|
||||
|
@ -178,9 +178,3 @@ struct NotificationRowView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct NotificationRowView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
NotificationRowView(notification: .placeholder())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ public struct NotificationsListView: View {
|
|||
@EnvironmentObject private var theme: Theme
|
||||
@EnvironmentObject private var watcher: StreamWatcher
|
||||
@EnvironmentObject private var client: Client
|
||||
@EnvironmentObject private var routerPath: RouterPath
|
||||
@EnvironmentObject private var account: CurrentAccount
|
||||
@StateObject private var viewModel = NotificationsViewModel()
|
||||
|
||||
|
@ -83,7 +84,7 @@ public struct NotificationsListView: View {
|
|||
switch viewModel.state {
|
||||
case .loading:
|
||||
ForEach(ConsolidatedNotification.placeholders()) { notification in
|
||||
NotificationRowView(notification: notification)
|
||||
NotificationRowView(notification: notification, client: client, routerPath: routerPath)
|
||||
.redacted(reason: .placeholder)
|
||||
.listRowInsets(.init(top: 12,
|
||||
leading: .layoutPadding + 4,
|
||||
|
@ -102,7 +103,7 @@ public struct NotificationsListView: View {
|
|||
.listSectionSeparator(.hidden)
|
||||
} else {
|
||||
ForEach(notifications) { notification in
|
||||
NotificationRowView(notification: notification)
|
||||
NotificationRowView(notification: notification, client: client, routerPath: routerPath)
|
||||
.listRowInsets(.init(top: 12,
|
||||
leading: .layoutPadding + 4,
|
||||
bottom: 12,
|
||||
|
|
Loading…
Reference in a new issue