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