Fix post view padding

Changelog-Fixed: Fix padding in post view
Closes: #879
This commit is contained in:
OlegAba
2023-04-05 16:56:59 -04:00
committed by William Casarin
parent 3f3892ba1d
commit b8226d674d
2 changed files with 18 additions and 16 deletions

View File

@@ -165,7 +165,7 @@ struct PostView: View {
} }
} }
.frame(height: 30) .frame(height: 30)
.padding([.bottom], 10) .padding()
} }
func append_url(_ url: String) { func append_url(_ url: String) {
@@ -219,13 +219,13 @@ struct PostView: View {
VStack(alignment: .leading, spacing: 0) { VStack(alignment: .leading, spacing: 0) {
HStack(alignment: .top) { HStack(alignment: .top) {
ProfilePicView(pubkey: damus_state.pubkey, size: PFP_SIZE, highlight: .none, profiles: damus_state.profiles) ProfilePicView(pubkey: damus_state.pubkey, size: PFP_SIZE, highlight: .none, profiles: damus_state.profiles)
.padding(.leading, replying_to != nil ? 15 : 0)
TextEntry TextEntry
} }
.frame(height: deviceSize.size.height*0.78) .frame(height: deviceSize.size.height*0.78)
.id("post") .id("post")
} }
.padding(.horizontal)
} }
.frame(maxHeight: searching == nil ? .infinity : 70) .frame(maxHeight: searching == nil ? .infinity : 70)
.onAppear { .onAppear {
@@ -236,17 +236,16 @@ struct PostView: View {
// This if-block observes @ for tagging // This if-block observes @ for tagging
if let searching { if let searching {
UserSearch(damus_state: damus_state, search: searching, post: $post) UserSearch(damus_state: damus_state, search: searching, post: $post)
.padding(.leading, replying_to != nil ? 15 : 0)
.frame(maxHeight: .infinity) .frame(maxHeight: .infinity)
} else { } else {
Divider() Divider()
.padding([.bottom], 10)
VStack(alignment: .leading) { VStack(alignment: .leading) {
AttachmentBar AttachmentBar
.padding(.vertical, 5)
.padding(.horizontal)
} }
} }
} }
.padding()
.sheet(isPresented: $attach_media) { .sheet(isPresented: $attach_media) {
ImagePicker(sourceType: .photoLibrary, pubkey: damus_state.pubkey) { img in ImagePicker(sourceType: .photoLibrary, pubkey: damus_state.pubkey) { img in
handle_upload(media: .image(img)) handle_upload(media: .image(img))

View File

@@ -72,19 +72,22 @@ struct UserSearch: View {
} }
var body: some View { var body: some View {
ScrollView { VStack(spacing: 0) {
LazyVStack { Divider()
Divider() ScrollView {
if users.count == 0 { LazyVStack {
EmptyUserSearchView() if users.count == 0 {
} else { EmptyUserSearchView()
ForEach(users) { user in } else {
UserView(damus_state: damus_state, pubkey: user.pubkey) ForEach(users) { user in
.onTapGesture { UserView(damus_state: damus_state, pubkey: user.pubkey)
on_user_tapped(user: user) .onTapGesture {
} on_user_tapped(user: user)
}
}
} }
} }
.padding()
} }
} }
} }