commit e2a4443a9c1c524634f610a5878f598ba555540a parent 7c0e1c5ded1b6a7849da49ec2a6d2df50ee44456 Author: William Casarin <jb55@jb55.com> Date: Wed, 16 Oct 2024 09:09:24 -0700 Merge 'Fix padding for views for tabbar' from github/pr/2589 Diffstat:
7 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/damus/Views/DMChatView.swift b/damus/Views/DMChatView.swift @@ -10,6 +10,7 @@ import Combine struct DMChatView: View, KeyboardReadable { let damus_state: DamusState + @FocusState private var isTextFieldFocused: Bool @ObservedObject var dms: DirectMessageModel var pubkey: Pubkey { @@ -46,6 +47,7 @@ struct DMChatView: View, KeyboardReadable { } } } + .padding(.bottom, isTextFieldFocused ? 0 : tabHeight) } func scroll_to_end(_ scroller: ScrollViewProxy, animated: Bool = false) { @@ -74,6 +76,7 @@ struct DMChatView: View, KeyboardReadable { .textEditorBackground { InputBackground() } + .focused($isTextFieldFocused) .cornerRadius(8) .background( RoundedRectangle(cornerRadius: 8) diff --git a/damus/Views/DirectMessagesView.swift b/damus/Views/DirectMessagesView.swift @@ -35,6 +35,7 @@ struct DirectMessagesView: View { } .padding(.horizontal) } + .padding(.bottom, tabHeight) } func filter_dms(dms: [DirectMessageModel]) -> [DirectMessageModel] { diff --git a/damus/Views/Profile/EditMetadataView.swift b/damus/Views/Profile/EditMetadataView.swift @@ -203,7 +203,7 @@ struct EditMetadataView: View { }) .buttonStyle(GradientButtonStyle(padding: 15)) .padding(.horizontal, 10) - .padding(.bottom, 10 + tabHeight + getSafeAreaBottom()) + .padding(.bottom, 10 + tabHeight) .disabled(!didChange()) .opacity(!didChange() ? 0.5 : 1) .disabled(profileUploadObserver.isLoading || bannerUploadObserver.isLoading) diff --git a/damus/Views/ReactionsView.swift b/damus/Views/ReactionsView.swift @@ -22,7 +22,7 @@ struct ReactionsView: View { } .padding() } - .padding(.bottom, tabHeight + getSafeAreaBottom()) + .padding(.bottom, tabHeight) .navigationBarTitle(NSLocalizedString("Reactions", comment: "Navigation bar title for Reactions view.")) .onAppear { model.subscribe() diff --git a/damus/Views/Reposts/QuoteRepostsView.swift b/damus/Views/Reposts/QuoteRepostsView.swift @@ -13,6 +13,7 @@ struct QuoteRepostsView: View { var body: some View { TimelineView<AnyView>(events: model.events, loading: $model.loading, damus: damus_state, show_friend_icon: true, filter: ContentFilters.default_filters(damus_state: damus_state).filter(ev:)) + .padding(.bottom, tabHeight) .navigationBarTitle(NSLocalizedString("Quotes", comment: "Navigation bar title for Quote Reposts view.")) .onAppear { model.subscribe() diff --git a/damus/Views/RepostsView.swift b/damus/Views/RepostsView.swift @@ -20,7 +20,7 @@ struct RepostsView: View { } .padding() } - .padding(.bottom, tabHeight + getSafeAreaBottom()) + .padding(.bottom, tabHeight) .navigationBarTitle(NSLocalizedString("Reposts", comment: "Navigation bar title for Reposts view.")) .onAppear { model.subscribe() diff --git a/damus/Views/Zaps/ZapsView.swift b/damus/Views/Zaps/ZapsView.swift @@ -28,7 +28,7 @@ struct ZapsView: View { } } } - .padding(.bottom, tabHeight + getSafeAreaBottom()) + .padding(.bottom, tabHeight) .navigationBarTitle(NSLocalizedString("Zaps", comment: "Navigation bar title for the Zaps view.")) .onAppear { model.subscribe()