tab bar fix (#241)

* Update JSController-NetworkFetch.swift

* Shitty AI code by paul

* Fix tab bar

---------

Co-authored-by: cranci1 <100066266+cranci1@users.noreply.github.com>
This commit is contained in:
50/50 2025-09-07 22:44:56 +04:00 committed by GitHub
parent 3ba52e7df1
commit cac8eba349
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,6 +64,10 @@ struct TabBar: View {
return white > 0.5 ? 0.5 : 0.3
}
private var shouldSlideUp: Bool {
return keyboardFocus && keyboardHeight > 100
}
@Namespace private var animation
private let tabWidth: CGFloat = 70
@ -280,9 +284,8 @@ struct TabBar: View {
.padding(.bottom, -100)
.padding(.top, -10)
}
.offset(y: keyboardFocus ? -keyboardHeight + 40 : 0)
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: keyboardHeight)
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: keyboardFocus)
.offset(y: shouldSlideUp ? -keyboardHeight + 40 : 0)
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: shouldSlideUp)
.onChange(of: keyboardHeight) { newValue in
withAnimation(.spring(response: 0.3, dampingFraction: 0.8)) {
}