Coordinate to Profile if there's an account (IOS-284)

This commit is contained in:
Nathan Mattes 2024-06-30 12:41:39 +02:00
parent 495332e021
commit 2876bcced6
4 changed files with 21 additions and 5 deletions

View File

@ -144,6 +144,17 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
}
}
func tableViewCell(
_ cell: UITableViewCell,
statusView: StatusView,
cardControl: StatusCardControl,
didTapProfile account: Mastodon.Entity.Account
) {
Task {
await DataSourceFacade.coordinateToProfileScene(provider:self, account: account)
}
}
func tableViewCell(
_ cell: UITableViewCell,
statusView: StatusView,

View File

@ -491,8 +491,9 @@ extension NotificationView {
// MARK: - StatusViewDelegate
extension NotificationView: StatusViewDelegate {
public func statusView(_ statusView: StatusView, didTapCardWithURL url: URL) {
assertionFailure()
public func statusView(_ statusView: StatusView, didTapCardWithURL url: URL) { assertionFailure() }
public func statusView(_ statusView: StatusView, cardControl: StatusCardControl, didTapProfile account: Mastodon.Entity.Account) {
// no op
}
public func statusView(_ statusView: StatusView, headerDidPressed header: UIView) {

View File

@ -40,6 +40,7 @@ protocol StatusTableViewCellDelegate: AnyObject, AutoGenerateProtocolDelegate {
func tableViewCell(_ cell: UITableViewCell, statusView: StatusView, statusMetricView: StatusMetricView, favoriteButtonDidPressed button: UIButton)
func tableViewCell(_ cell: UITableViewCell, statusView: StatusView, statusMetricView: StatusMetricView, showEditHistory button: UIButton)
func tableViewCell(_ cell: UITableViewCell, statusView: StatusView, cardControl: StatusCardControl, didTapURL url: URL)
func tableViewCell(_ cell: UITableViewCell, statusView: StatusView, cardControl: StatusCardControl, didTapProfile account: Mastodon.Entity.Account)
func tableViewCell(_ cell: UITableViewCell, statusView: StatusView, cardControlMenu: StatusCardControl) -> [LabeledAction]?
func tableViewCell(_ cell: UITableViewCell, statusView: StatusView, accessibilityActivate: Void)
// sourcery:end
@ -114,6 +115,10 @@ extension StatusViewDelegate where Self: StatusViewContainerTableViewCell {
delegate?.tableViewCell(self, statusView: statusView, cardControl: cardControl, didTapURL: url)
}
func statusView(_ statusView: StatusView, cardControl: StatusCardControl, didTapProfile account: Mastodon.Entity.Account) {
delegate?.tableViewCell(self, statusView: statusView, cardControl: cardControl, didTapProfile: account)
}
func statusView(_ statusView: StatusView, cardControlMenu: StatusCardControl) -> [LabeledAction]? {
return delegate?.tableViewCell(self, statusView: statusView, cardControlMenu: cardControlMenu)
}

View File

@ -35,6 +35,7 @@ public protocol StatusViewDelegate: AnyObject {
func statusView(_ statusView: StatusView, statusMetricView: StatusMetricView, favoriteButtonDidPressed button: UIButton)
func statusView(_ statusView: StatusView, statusMetricView: StatusMetricView, showEditHistory button: UIButton)
func statusView(_ statusView: StatusView, cardControl: StatusCardControl, didTapURL url: URL)
func statusView(_ statusView: StatusView, cardControl: StatusCardControl, didTapProfile account: Mastodon.Entity.Account)
func statusView(_ statusView: StatusView, cardControlMenu: StatusCardControl) -> [LabeledAction]?
// a11y
@ -792,9 +793,7 @@ extension StatusView: MastodonMenuDelegate {
// MARK: StatusCardControlDelegate
extension StatusView: StatusCardControlDelegate {
public func statusCardControl(_ statusCardControl: StatusCardControl, didTapAuthor author: Mastodon.Entity.Account) {
//TODO: Profile to Author-profile
print("Show \(author.displayName)")
delegate?.statusView(self, cardControl: statusCardControl, didTapProfile: author)
}
public func statusCardControl(_ statusCardControl: StatusCardControl, didTapURL url: URL) {