Skip to content

Commit f2ca60c

Browse files
authored
Merge pull request #18627 from wordpress-mobile/feature/18429-disable_remove_from_dashboard
Blogging Prompts Dashboard Card: don't show remove menu item.
2 parents 8f15251 + 377da1e commit f2ca60c

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable {
7373
}
7474
}
7575

76+
// This provides a quick way to toggle the `Remove from dashboard` menu item.
77+
// Since it (probably) will not be included in Blogging Prompts V1, it is disabled by default.
78+
private let removeFromDashboardEnabled = false
79+
7680
// Used to present:
7781
// - The menu sheet for contextual menu in iOS13.
7882
// - The Blogging Prompts list when selected from the contextual menu.
@@ -273,15 +277,16 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable {
273277

274278
// Defines the structure of the contextual menu items.
275279
private var contextMenuItems: [[MenuItem]] {
276-
return [
277-
[
278-
.viewMore(viewMoreMenuTapped),
279-
.skip(skipMenuTapped)
280-
],
281-
[
282-
.remove(removeMenuTapped)
283-
]
280+
let defaultItems: [MenuItem] = [
281+
.viewMore(viewMoreMenuTapped),
282+
.skip(skipMenuTapped)
284283
]
284+
285+
if removeFromDashboardEnabled {
286+
return [defaultItems, [.remove(removeMenuTapped)]]
287+
}
288+
289+
return [defaultItems]
285290
}
286291

287292
private var contextMenu: UIMenu {

0 commit comments

Comments
 (0)