Cleanup isSecondaryColumn

This commit is contained in:
Thomas Ricouard 2023-01-29 17:59:04 +01:00
parent d2c520d306
commit 941618686c
3 changed files with 5 additions and 4 deletions

View File

@ -118,7 +118,7 @@ struct IceCubesApp: App {
if proxy.frame(in: .global).width > (.maxColumnWidth + .secondaryColumnWidth),
currentAccount.account?.id != nil {
Divider().edgesIgnoringSafeArea(.all)
NotificationsTab(popToRootTab: $popToRootTab, lockedType: nil, isSecondaryColumn: true)
NotificationsTab(popToRootTab: $popToRootTab, lockedType: nil)
.environment(\.isSecondaryColumn, true)
.frame(maxWidth: 360)
}

View File

@ -8,6 +8,8 @@ import SwiftUI
import Timeline
struct NotificationsTab: View {
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var client: Client
@EnvironmentObject private var watcher: StreamWatcher
@ -18,7 +20,6 @@ struct NotificationsTab: View {
@Binding var popToRootTab: Tab
let lockedType: Models.Notification.NotificationType?
let isSecondaryColumn: Bool
var body: some View {
NavigationStack(path: $routerPath.path) {

View File

@ -37,9 +37,9 @@ enum Tab: Int, Identifiable, Hashable {
case .federated:
TimelineTab(popToRootTab: popToRootTab, timeline: .federated)
case .notifications:
NotificationsTab(popToRootTab: popToRootTab, lockedType: nil, isSecondaryColumn: false)
NotificationsTab(popToRootTab: popToRootTab, lockedType: nil)
case .mentions:
NotificationsTab(popToRootTab: popToRootTab, lockedType: .mention, isSecondaryColumn: false)
NotificationsTab(popToRootTab: popToRootTab, lockedType: .mention)
case .explore:
ExploreTab(popToRootTab: popToRootTab)
case .messages: