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