Fix tap area when mentioning users
Changelog-Fixed: Fix tap area when mentioning users Closes: #895
This commit is contained in:
@@ -7,11 +7,34 @@
|
|||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
struct UserViewRow: View {
|
||||||
|
let damus_state: DamusState
|
||||||
|
let pubkey: String
|
||||||
|
|
||||||
|
@State var navigating: Bool = false
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
let dest = ProfileView(damus_state: damus_state, pubkey: pubkey)
|
||||||
|
|
||||||
|
UserView(damus_state: damus_state, pubkey: pubkey)
|
||||||
|
.contentShape(Rectangle())
|
||||||
|
.background(
|
||||||
|
NavigationLink(destination: dest, isActive: $navigating) {
|
||||||
|
EmptyView()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.onTapGesture {
|
||||||
|
navigating = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct UserView: View {
|
struct UserView: View {
|
||||||
let damus_state: DamusState
|
let damus_state: DamusState
|
||||||
let pubkey: String
|
let pubkey: String
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
|
||||||
VStack {
|
VStack {
|
||||||
HStack {
|
HStack {
|
||||||
ProfilePicView(pubkey: pubkey, size: PFP_SIZE, highlight: .none, profiles: damus_state.profiles)
|
ProfilePicView(pubkey: pubkey, size: PFP_SIZE, highlight: .none, profiles: damus_state.profiles)
|
||||||
@@ -28,7 +51,6 @@ struct UserView: View {
|
|||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
Spacer()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,11 @@ struct FollowUserView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
UserView(damus_state: damus_state, pubkey: target.pubkey)
|
UserViewRow(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))
|
||||||
}
|
}
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ struct MutelistView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List(users, id: \.self) { pubkey in
|
List(users, id: \.self) { pubkey in
|
||||||
UserView(damus_state: damus_state, pubkey: pubkey)
|
UserViewRow(damus_state: damus_state, pubkey: pubkey)
|
||||||
.id(pubkey)
|
.id(pubkey)
|
||||||
.swipeActions {
|
.swipeActions {
|
||||||
RemoveAction(pubkey: pubkey)
|
RemoveAction(pubkey: pubkey)
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ struct RelayDetailView: View {
|
|||||||
|
|
||||||
if let pubkey = nip11.pubkey {
|
if let pubkey = nip11.pubkey {
|
||||||
Section(NSLocalizedString("Admin", comment: "Label to display relay contact user.")) {
|
Section(NSLocalizedString("Admin", comment: "Label to display relay contact user.")) {
|
||||||
UserView(damus_state: state, pubkey: pubkey)
|
UserViewRow(damus_state: state, pubkey: pubkey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Section(NSLocalizedString("Relay", comment: "Label to display relay address.")) {
|
Section(NSLocalizedString("Relay", comment: "Label to display relay address.")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user