Skip to content

Commit

Permalink
Show profile view when tapped author name in home feed (#1380)
Browse files Browse the repository at this point in the history
Show profile when tap AuthorName
  • Loading branch information
gokulvenkat243 authored Dec 16, 2024
1 parent 54ee560 commit e4214f7
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ extension StatusAuthorView {

// avatar button
avatarButton.addTarget(self, action: #selector(StatusAuthorView.authorAvatarButtonDidPressed(_:)), for: .touchUpInside)
authorNameLabel.isUserInteractionEnabled = false
authorNameLabel.isUserInteractionEnabled = true
authorUsernameLabel.isUserInteractionEnabled = false

// contentSensitiveeToggleButton
contentSensitiveeToggleButton.addTarget(self, action: #selector(StatusAuthorView.contentSensitiveeToggleButtonDidPressed(_:)), for: .touchUpInside)

// dateLabel
dateLabel.isUserInteractionEnabled = false
self.addTapGestureToAuthorName()
}
}

Expand Down Expand Up @@ -215,6 +216,10 @@ extension StatusAuthorView {
return (menu, accessibilityActions)
}

private func addTapGestureToAuthorName() {
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(StatusAuthorView.authorNameDidPressed(_:)))
authorNameLabel.addGestureRecognizer(tapGesture)
}
}

extension StatusAuthorView {
Expand All @@ -224,6 +229,12 @@ extension StatusAuthorView {
statusView.delegate?.statusView(statusView, authorAvatarButtonDidPressed: avatarButton)
}

@objc private func authorNameDidPressed(_ sender: UIButton) {
guard let statusView = statusView else { return }

statusView.delegate?.statusView(statusView, authorAvatarButtonDidPressed: avatarButton)
}

@objc private func contentSensitiveeToggleButtonDidPressed(_ sender: UIButton) {
guard let statusView = statusView else { return }

Expand Down

0 comments on commit e4214f7

Please sign in to comment.