LNBottomSheetMenu+Feed.swift 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // LNBottomSheetMenu+Feed.swift
  3. // Gami
  4. //
  5. // Created by OneeChan on 2026/3/4.
  6. //
  7. import Foundation
  8. extension LNBottomSheetMenu {
  9. static func showFeedMenu(detail: LNFeedDetailVO, view: UIView) {
  10. let panel = LNBottomSheetMenu()
  11. let menu: [String] = [
  12. detail.userNo.isMyUid == true ? .init(key: "A00307") : .init(key: "A00043"),
  13. .init(key: "A00003")
  14. ]
  15. panel.update(menu) { [weak view] index, _ in
  16. guard let view else { return }
  17. if index == 0 {
  18. if detail.userNo.isMyUid {
  19. let alert = LNCommonAlertView()
  20. alert.titleLabel.text = .init(key: "A00308")
  21. alert.showConfirm { [weak view] in
  22. guard let view else { return }
  23. LNFeedManager.shared.deleteFeed(id: detail.id) { [weak view] success in
  24. guard let view else { return }
  25. guard success else { return }
  26. view.navigationController?.popViewController(animated: true)
  27. }
  28. }
  29. alert.showCancel()
  30. alert.popup()
  31. } else {
  32. view.pushToReport(uid: detail.userNo)
  33. }
  34. }
  35. }
  36. panel.popup()
  37. }
  38. }