From 377da1e9adc8f8b9816556ff3c7cf7bb343fbc2d Mon Sep 17 00:00:00 2001 From: Stephenie Harris Date: Mon, 16 May 2022 14:06:33 -0600 Subject: [PATCH] Don't show remove menu item. --- .../Prompts/DashboardPromptsCardCell.swift | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift index c86243ebacc1..3e9355412e2e 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift @@ -73,6 +73,10 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable { } } + // This provides a quick way to toggle the `Remove from dashboard` menu item. + // Since it (probably) will not be included in Blogging Prompts V1, it is disabled by default. + private let removeFromDashboardEnabled = false + // Used to present: // - The menu sheet for contextual menu in iOS13. // - The Blogging Prompts list when selected from the contextual menu. @@ -273,15 +277,16 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable { // Defines the structure of the contextual menu items. private var contextMenuItems: [[MenuItem]] { - return [ - [ - .viewMore(viewMoreMenuTapped), - .skip(skipMenuTapped) - ], - [ - .remove(removeMenuTapped) - ] + let defaultItems: [MenuItem] = [ + .viewMore(viewMoreMenuTapped), + .skip(skipMenuTapped) ] + + if removeFromDashboardEnabled { + return [defaultItems, [.remove(removeMenuTapped)]] + } + + return [defaultItems] } private var contextMenu: UIMenu {