@@ -12,23 +12,15 @@ struct ReaderPostMenu {
1212 func makeMenu( ) -> [ UIMenuElement ] {
1313 return [
1414 makePrimaryActions ( ) ,
15- makeSecondaryActions ( ) ,
1615 shouldShowReportOrBlockMenu ? makeBlockOrReportActions ( ) : nil
1716 ] . compactMap { $0 }
1817 }
1918
2019 private func makePrimaryActions( ) -> UIMenu {
21- let menu = UIMenu ( options: [ . displayInline] , children: [
22- share, comment, like, bookmark, reblog
23- ] . compactMap { $0 } )
24- menu. preferredElementSize = . medium
25- return menu
26- }
27-
28- private func makeSecondaryActions( ) -> UIMenu {
2920 UIMenu ( options: [ . displayInline] , children: [
30- viewPostInBrowser ,
21+ share ,
3122 copyPostLink,
23+ viewPostInBrowser,
3224 makeBlogMenu ( ) ,
3325 ] . compactMap { $0 } )
3426 }
@@ -59,41 +51,6 @@ struct ReaderPostMenu {
5951 }
6052 }
6153
62- private var bookmark : UIAction {
63- let isBookmarked = post. isSavedForLater
64- return UIAction ( isBookmarked ? Strings . bookmarked : Strings . bookmark, systemImage: isBookmarked ? " bookmark.fill " : " bookmark " ) {
65- guard let viewController else { return }
66- ReaderSaveForLaterAction ( ) . execute ( with: post, origin: . otherStream, viewController: viewController)
67- track ( isBookmarked ? . removeBookmark : . bookmark)
68- }
69- }
70-
71- private var reblog : UIAction {
72- UIAction ( Strings . reblog, systemImage: " arrow.2.squarepath " ) {
73- guard let viewController else { return }
74- ReaderSaveForLaterAction ( ) . execute ( with: post, origin: . otherStream, viewController: viewController)
75- track ( . reblog)
76- }
77- }
78-
79- private var comment : UIAction ? {
80- guard post. isCommentsEnabled else { return nil }
81- return UIAction ( Strings . comment, systemImage: " message " ) {
82- guard let viewController else { return }
83- ReaderCommentAction ( ) . execute ( post: post, origin: viewController, source: . postCard)
84- track ( . comment)
85- }
86- }
87-
88- private var like : UIAction ? {
89- guard post. isLikesEnabled else { return nil }
90- let isLiked = post. isLiked
91- return UIAction ( isLiked ? Strings . liked : Strings . like, systemImage: isLiked ? " star.fill " : " star " ) {
92- ReaderLikeAction ( ) . execute ( with: post)
93- track ( isLiked ? . removeLike : . like)
94- }
95- }
96-
9754 private var viewPostInBrowser : UIAction ? {
9855 guard let postURL = post. permaLink. flatMap ( URL . init) else { return nil }
9956 let action = UIAction ( Strings . viewInBrowser, systemImage: " safari " ) {
@@ -220,12 +177,6 @@ private extension UIAction {
220177
221178private enum ReaderPostMenuAnalyticsButton : String {
222179 case share = " share "
223- case bookmark = " bookmark "
224- case removeBookmark = " remove_bookmark "
225- case like = " like "
226- case removeLike = " remove_like "
227- case comment = " comment "
228- case reblog = " reblog "
229180 case viewPostInBrowser = " view_in_browser "
230181 case copyPostLink = " copy_post_link "
231182 case goToBlog = " blog_open "
@@ -241,12 +192,6 @@ private enum ReaderPostMenuAnalyticsButton: String {
241192
242193private enum Strings {
243194 static let share = NSLocalizedString ( " reader.postContextMenu.share " , value: " Share " , comment: " Context menu action " )
244- static let bookmark = NSLocalizedString ( " reader.postContextMenu.bookmark " , value: " Bookmark " , comment: " Context menu action " )
245- static let bookmarked = NSLocalizedString ( " reader.postContextMenu.bookmarked " , value: " Bookmarked " , comment: " Context menu action " )
246- static let reblog = NSLocalizedString ( " reader.postContextMenu.reblog " , value: " Reblog " , comment: " Context menu action " )
247- static let comment = NSLocalizedString ( " reader.postContextMenu.comment " , value: " Comment " , comment: " Context menu action " )
248- static let like = NSLocalizedString ( " reader.postContextMenu.like " , value: " Like " , comment: " Context menu action " )
249- static let liked = NSLocalizedString ( " reader.postContextMenu.liked " , value: " Liked " , comment: " Context menu action " )
250195 static let viewInBrowser = NSLocalizedString ( " reader.postContextMenu.viewInBrowser " , value: " View in Browser " , comment: " Context menu action " )
251196 static let copyLink = NSLocalizedString ( " reader.postContextMenu.copyLink " , value: " Copy Link " , comment: " Context menu action " )
252197 static let blockOrReport = NSLocalizedString ( " reader.postContextMenu.blockOrReportMenu " , value: " Block or Report " , comment: " Context menu action " )
0 commit comments