Remove tab bar in settings
This commit is contained in:
parent
ac6219450a
commit
f52716f748
@ -275,3 +275,9 @@ public final class Client: Equatable, Identifiable, Hashable {
|
||||
}
|
||||
|
||||
extension Client: Sendable {}
|
||||
|
||||
extension CGFloat {
|
||||
static func getFontSize(from font: UIFont.TextStyle) -> CGFloat {
|
||||
return UIFont.preferredFont(forTextStyle: font).pointSize
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,10 @@ public class Navigator: ObservableObject {
|
||||
}
|
||||
private var currentTab: TabDestination = .timeline
|
||||
|
||||
public var inSettings: Bool {
|
||||
self.path.contains(RouterDestination.allSettings)
|
||||
}
|
||||
|
||||
public private(set) var memorizedNav: [TabDestination : [RouterDestination]] = [:]
|
||||
public var showTabbar: Bool {
|
||||
get {
|
||||
|
@ -44,10 +44,15 @@ struct ContentView: View {
|
||||
TabsView(postButton: {
|
||||
uniNavigator.presentedSheet = .post(content: "", replyId: nil, editId: nil)
|
||||
}, retapAction: {
|
||||
Navigator.shared.path = []
|
||||
navigator.path = []
|
||||
// Navigator.shared.showTabbar.toggle()
|
||||
})
|
||||
.safeAreaPadding(.vertical, 10)
|
||||
.zIndex(10)
|
||||
.offset(
|
||||
y: navigator.showTabbar ? 0 : CGFloat
|
||||
.getFontSize(from: .extraLargeTitle) * 7.5
|
||||
)
|
||||
}
|
||||
.withSheets(sheetDestination: $uniNavigator.presentedSheet)
|
||||
.withCovers(sheetDestination: $uniNavigator.presentedCover)
|
||||
@ -57,6 +62,11 @@ struct ContentView: View {
|
||||
.environment(huggingFace)
|
||||
.environmentObject(preferences)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.onChange(of: navigator.path) { _, newValue in
|
||||
guard !newValue.isEmpty else { navigator.showTabbar = true; return }
|
||||
navigator.showTabbar = newValue
|
||||
.filter({ $0 == RouterDestination.settings }).first == nil
|
||||
}
|
||||
.onAppear {
|
||||
showNew()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user