Fix tap area when mentioning users
Changelog-Fixed: Fix tap area when mentioning users Closes: #895
This commit is contained in:
@@ -12,22 +12,24 @@ struct UserView: View {
|
|||||||
let pubkey: String
|
let pubkey: String
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationLink(destination: ProfileView(damus_state: damus_state, pubkey: pubkey)) {
|
VStack {
|
||||||
ProfilePicView(pubkey: pubkey, size: PFP_SIZE, highlight: .none, profiles: damus_state.profiles)
|
HStack {
|
||||||
|
ProfilePicView(pubkey: pubkey, size: PFP_SIZE, highlight: .none, profiles: damus_state.profiles)
|
||||||
VStack(alignment: .leading) {
|
|
||||||
let profile = damus_state.profiles.lookup(id: pubkey)
|
|
||||||
ProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_friend_confirmed: false, show_nip5_domain: false)
|
|
||||||
if let about = profile?.about {
|
|
||||||
Text(about)
|
|
||||||
.lineLimit(3)
|
|
||||||
.font(.footnote)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
VStack(alignment: .leading) {
|
||||||
|
let profile = damus_state.profiles.lookup(id: pubkey)
|
||||||
|
ProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_friend_confirmed: false, show_nip5_domain: false)
|
||||||
|
if let about = profile?.about {
|
||||||
|
Text(about)
|
||||||
|
.lineLimit(3)
|
||||||
|
.font(.footnote)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
.buttonStyle(PlainButtonStyle())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,20 @@ struct FollowUserView: View {
|
|||||||
let damus_state: DamusState
|
let damus_state: DamusState
|
||||||
|
|
||||||
static let markdown = Markdown()
|
static let markdown = Markdown()
|
||||||
|
@State var navigating: Bool = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
let dest = ProfileView(damus_state: damus_state, pubkey: target.pubkey)
|
||||||
|
NavigationLink(destination: dest, isActive: $navigating) {
|
||||||
|
EmptyView()
|
||||||
|
}
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
UserView(damus_state: damus_state, pubkey: target.pubkey)
|
UserView(damus_state: damus_state, pubkey: target.pubkey)
|
||||||
|
.contentShape(Rectangle())
|
||||||
|
.onTapGesture {
|
||||||
|
navigating = true
|
||||||
|
}
|
||||||
|
|
||||||
FollowButtonView(target: target, follows_you: false, follow_state: damus_state.contacts.follow_state(target.pubkey))
|
FollowButtonView(target: target, follows_you: false, follow_state: damus_state.contacts.follow_state(target.pubkey))
|
||||||
}
|
}
|
||||||
@@ -33,10 +43,9 @@ struct FollowersView: View {
|
|||||||
LazyVStack(alignment: .leading) {
|
LazyVStack(alignment: .leading) {
|
||||||
ForEach(followers.contacts ?? [], id: \.self) { pk in
|
ForEach(followers.contacts ?? [], id: \.self) { pk in
|
||||||
FollowUserView(target: .pubkey(pk), damus_state: damus_state)
|
FollowUserView(target: .pubkey(pk), damus_state: damus_state)
|
||||||
Divider()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding()
|
.padding(.horizontal)
|
||||||
}
|
}
|
||||||
.navigationBarTitle(NSLocalizedString("Followers", comment: "Navigation bar title for view that shows who is following a user."))
|
.navigationBarTitle(NSLocalizedString("Followers", comment: "Navigation bar title for view that shows who is following a user."))
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ struct UserSearch: View {
|
|||||||
} else {
|
} else {
|
||||||
ForEach(users) { user in
|
ForEach(users) { user in
|
||||||
UserView(damus_state: damus_state, pubkey: user.pubkey)
|
UserView(damus_state: damus_state, pubkey: user.pubkey)
|
||||||
|
.contentShape(Rectangle())
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
on_user_tapped(user: user)
|
on_user_tapped(user: user)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user