Skip to content

Commit

Permalink
ux: add long press to profile to navigate to profile page
Browse files Browse the repository at this point in the history
Changelog-Added: Long press on a profile image navigates to their page
  • Loading branch information
ericholguin committed Oct 28, 2023
1 parent 7710839 commit 418557c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions damus/Views/Events/EventProfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions damus/Views/Profile/MaybeAnonPfpView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
}
Expand Down

0 comments on commit 418557c

Please sign in to comment.