new top / bottom bar
This commit is contained in:
parent
016e4d5d57
commit
3eec5c0eec
|
@ -89,7 +89,7 @@ struct AppView: View {
|
|||
}
|
||||
.tag(tab)
|
||||
.badge(badgeFor(tab: tab))
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .tabBar)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .tabBar)
|
||||
}
|
||||
}
|
||||
.id(appAccountsManager.currentClient.id)
|
||||
|
|
|
@ -21,7 +21,7 @@ struct ExploreTab: View {
|
|||
ExploreView(scrollToTopSignal: $scrollToTopSignal)
|
||||
.withAppRouter()
|
||||
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
|
||||
.toolbar {
|
||||
ToolbarTab(routerPath: $routerPath)
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ struct MessagesTab: View {
|
|||
.toolbar {
|
||||
ToolbarTab(routerPath: $routerPath)
|
||||
}
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
|
||||
.id(client.id)
|
||||
}
|
||||
.onChange(of: $popToRootTab.wrappedValue) { _, newValue in
|
||||
|
|
|
@ -32,7 +32,7 @@ struct NavigationTab<Content: View>: View {
|
|||
.toolbar {
|
||||
ToolbarTab(routerPath: $routerPath)
|
||||
}
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
|
||||
.onChange(of: client.id) {
|
||||
routerPath.path = []
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ struct NotificationsTab: View {
|
|||
}
|
||||
ToolbarTab(routerPath: $routerPath)
|
||||
}
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
|
||||
.id(client.id)
|
||||
}
|
||||
.onAppear {
|
||||
|
|
|
@ -23,7 +23,7 @@ struct ProfileTab: View {
|
|||
AccountDetailView(account: account, scrollToTopSignal: $scrollToTopSignal)
|
||||
.withAppRouter()
|
||||
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
|
||||
.id(account.id)
|
||||
} else {
|
||||
AccountDetailView(account: .placeholder(), scrollToTopSignal: $scrollToTopSignal)
|
||||
|
|
|
@ -47,7 +47,7 @@ struct SettingsTabs: View {
|
|||
#endif
|
||||
.navigationTitle(Text("settings.title"))
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
|
||||
.toolbar {
|
||||
if isModal {
|
||||
ToolbarItem {
|
||||
|
|
|
@ -51,7 +51,7 @@ struct TimelineTab: View {
|
|||
.toolbar {
|
||||
toolbarView
|
||||
}
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
|
||||
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
|
||||
.id(client.id)
|
||||
}
|
||||
.onAppear {
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import SwiftUI
|
||||
|
||||
public extension View {
|
||||
@ViewBuilder func `if`<Content: View>(_ condition: Bool, transform: (Self) -> Content) -> some View {
|
||||
if condition {
|
||||
transform(self)
|
||||
} else {
|
||||
self
|
||||
}
|
||||
}
|
||||
}
|
|
@ -82,13 +82,19 @@ public struct TimelineView: View {
|
|||
}
|
||||
.safeAreaInset(edge: .top, spacing: 0) {
|
||||
if canFilterTimeline, !pinnedFilters.isEmpty {
|
||||
VStack(spacing: 0) {
|
||||
TimelineQuickAccessPills(pinnedFilters: $pinnedFilters, timeline: $timeline)
|
||||
.padding(.vertical, 8)
|
||||
.padding(.horizontal, .layoutPadding)
|
||||
.background(theme.primaryBackgroundColor.opacity(0.50))
|
||||
.background(Material.regular)
|
||||
.background(theme.primaryBackgroundColor.opacity(0.30))
|
||||
.background(Material.ultraThin)
|
||||
Divider()
|
||||
}
|
||||
}
|
||||
}
|
||||
.if(canFilterTimeline && !pinnedFilters.isEmpty) { view in
|
||||
view.toolbarBackground(.hidden, for: .navigationBar)
|
||||
}
|
||||
.onChange(of: viewModel.scrollToIndex) { _, newValue in
|
||||
if let collectionView,
|
||||
let newValue,
|
||||
|
|
Loading…
Reference in New Issue