new top / bottom bar

This commit is contained in:
Thomas Ricouard 2024-01-23 08:51:58 +01:00
parent 016e4d5d57
commit 3eec5c0eec
10 changed files with 30 additions and 13 deletions

View file

@ -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)

View file

@ -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)
}

View file

@ -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

View file

@ -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 = []
}

View file

@ -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 {

View file

@ -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)

View file

@ -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 {

View file

@ -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 {

View file

@ -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
}
}
}

View file

@ -82,13 +82,19 @@ public struct TimelineView: View {
}
.safeAreaInset(edge: .top, spacing: 0) {
if canFilterTimeline, !pinnedFilters.isEmpty {
TimelineQuickAccessPills(pinnedFilters: $pinnedFilters, timeline: $timeline)
.padding(.vertical, 8)
.padding(.horizontal, .layoutPadding)
.background(theme.primaryBackgroundColor.opacity(0.50))
.background(Material.regular)
VStack(spacing: 0) {
TimelineQuickAccessPills(pinnedFilters: $pinnedFilters, timeline: $timeline)
.padding(.vertical, 8)
.padding(.horizontal, .layoutPadding)
.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,