damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit b8226d674dd24bd02ceef8fac7e2622dd2043823
parent 3f3892ba1d7e92765384cb68aaeacc58b848ec81
Author: OlegAba <mail@olegaba.com>
Date:   Wed,  5 Apr 2023 16:56:59 -0400

Fix post view padding

Changelog-Fixed: Fix padding in post view
Closes: #879

Diffstat:
Mdamus/Views/PostView.swift | 9++++-----
Mdamus/Views/Posting/UserSearch.swift | 25++++++++++++++-----------
2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/damus/Views/PostView.swift b/damus/Views/PostView.swift @@ -165,7 +165,7 @@ struct PostView: View { } } .frame(height: 30) - .padding([.bottom], 10) + .padding() } func append_url(_ url: String) { @@ -219,13 +219,13 @@ struct PostView: View { VStack(alignment: .leading, spacing: 0) { HStack(alignment: .top) { ProfilePicView(pubkey: damus_state.pubkey, size: PFP_SIZE, highlight: .none, profiles: damus_state.profiles) - .padding(.leading, replying_to != nil ? 15 : 0) TextEntry } .frame(height: deviceSize.size.height*0.78) .id("post") } + .padding(.horizontal) } .frame(maxHeight: searching == nil ? .infinity : 70) .onAppear { @@ -236,17 +236,16 @@ struct PostView: View { // This if-block observes @ for tagging if let searching { UserSearch(damus_state: damus_state, search: searching, post: $post) - .padding(.leading, replying_to != nil ? 15 : 0) .frame(maxHeight: .infinity) } else { Divider() - .padding([.bottom], 10) VStack(alignment: .leading) { AttachmentBar + .padding(.vertical, 5) + .padding(.horizontal) } } } - .padding() .sheet(isPresented: $attach_media) { ImagePicker(sourceType: .photoLibrary, pubkey: damus_state.pubkey) { img in handle_upload(media: .image(img)) diff --git a/damus/Views/Posting/UserSearch.swift b/damus/Views/Posting/UserSearch.swift @@ -72,19 +72,22 @@ struct UserSearch: View { } var body: some View { - ScrollView { - LazyVStack { - Divider() - if users.count == 0 { - EmptyUserSearchView() - } else { - ForEach(users) { user in - UserView(damus_state: damus_state, pubkey: user.pubkey) - .onTapGesture { - on_user_tapped(user: user) - } + VStack(spacing: 0) { + Divider() + ScrollView { + LazyVStack { + if users.count == 0 { + EmptyUserSearchView() + } else { + ForEach(users) { user in + UserView(damus_state: damus_state, pubkey: user.pubkey) + .onTapGesture { + on_user_tapped(user: user) + } + } } } + .padding() } } }