From c437a05ec0b7af36e99957fd955bf0100217615c Mon Sep 17 00:00:00 2001 From: ericholguin Date: Sat, 28 Oct 2023 16:31:17 -0600 Subject: [PATCH] ux: add long press to profile to navigate to profile page Closes: https://github.com/damus-io/damus/pull/1665 Reviewed-by: William Casarin Signed-off-by: William Casarin --- damus/Views/Events/EventProfile.swift | 4 ++++ damus/Views/Profile/MaybeAnonPfpView.swift | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/damus/Views/Events/EventProfile.swift b/damus/Views/Events/EventProfile.swift index ac5130c74..66c281ddf 100644 --- a/damus/Views/Events/EventProfile.swift +++ b/damus/Views/Events/EventProfile.swift @@ -41,6 +41,10 @@ struct EventProfile: View { .onTapGesture { show_profile_action_sheet_if_enabled(damus_state: damus_state, pubkey: pubkey) } + .onLongPressGesture(minimumDuration: 0.1) { + UIImpactFeedbackGenerator(style: .medium).impactOccurred() + damus_state.nav.push(route: Route.ProfileByKey(pubkey: pubkey)) + } VStack(alignment: .leading, spacing: 0) { EventProfileName(pubkey: pubkey, damus: damus_state, size: size) diff --git a/damus/Views/Profile/MaybeAnonPfpView.swift b/damus/Views/Profile/MaybeAnonPfpView.swift index f5cf1249e..d0b527e4d 100644 --- a/damus/Views/Profile/MaybeAnonPfpView.swift +++ b/damus/Views/Profile/MaybeAnonPfpView.swift @@ -32,6 +32,10 @@ struct MaybeAnonPfpView: View { .onTapGesture { show_profile_action_sheet_if_enabled(damus_state: state, pubkey: pubkey) } + .onLongPressGesture(minimumDuration: 0.1) { + UIImpactFeedbackGenerator(style: .medium).impactOccurred() + state.nav.push(route: Route.ProfileByKey(pubkey: pubkey)) + } } } }