diff --git a/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController+FAB.swift b/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController+FAB.swift index 5d6efbbafa33..8ff5194ea17b 100644 --- a/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController+FAB.swift +++ b/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController+FAB.swift @@ -28,7 +28,7 @@ extension MySiteViewController { var actions: [ActionSheetItem] = [] - if shouldShowNewStory { + if StoryAction.shouldBeShown(blog: blog) { actions.append(StoryAction(handler: newStory, source: source)) } @@ -38,8 +38,4 @@ extension MySiteViewController { let coordinator = CreateButtonCoordinator(self, actions: actions, source: source, blog: blog) return coordinator } - - private var shouldShowNewStory: Bool { - return (blog?.supports(.stories) ?? false) && !UIDevice.isPad() - } } diff --git a/WordPress/Classes/ViewRelated/Post/PostListViewController.swift b/WordPress/Classes/ViewRelated/Post/PostListViewController.swift index a39803d86a54..7a1721d8dddb 100644 --- a/WordPress/Classes/ViewRelated/Post/PostListViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/PostListViewController.swift @@ -186,7 +186,7 @@ class PostListViewController: AbstractPostListViewController, UIViewControllerRe self?.createPost() }, source: Constants.source) ] - if blog.supports(.stories) { + if StoryAction.shouldBeShown(blog: blog) { actions.insert(StoryAction(handler: { [weak self] in guard let self = self else { return diff --git a/WordPress/Classes/ViewRelated/System/Floating Create Button/CreateButtonCoordinator.swift b/WordPress/Classes/ViewRelated/System/Floating Create Button/CreateButtonCoordinator.swift index 1f647824522f..adb360888602 100644 --- a/WordPress/Classes/ViewRelated/System/Floating Create Button/CreateButtonCoordinator.swift +++ b/WordPress/Classes/ViewRelated/System/Floating Create Button/CreateButtonCoordinator.swift @@ -22,7 +22,7 @@ import WordPressFlux private let noticeAnimator = NoticeAnimator(duration: 0.5, springDampening: 0.7, springVelocity: 0.0) private func notice(for blog: Blog) -> Notice { - let showsStories = blog.supports(.stories) + let showsStories = StoryAction.shouldBeShown(blog: blog) let title = showsStories ? NSLocalizedString("Create a post, page, or story", comment: "The tooltip title for the Floating Create Button") : NSLocalizedString("Creates new post, or page", comment: " Accessibility hint for create floating action button") let notice = Notice(title: title, message: "", @@ -201,7 +201,7 @@ import WordPressFlux } @objc func showCreateButton(for blog: Blog) { - let showsStories = blog.supports(.stories) + let showsStories = StoryAction.shouldBeShown(blog: blog) button.accessibilityHint = showsStories ? NSLocalizedString("Creates new post, page, or story", comment: " Accessibility hint for create floating action button") : NSLocalizedString("Create a post or page", comment: " Accessibility hint for create floating action button") showCreateButton(notice: notice(for: blog)) } diff --git a/WordPress/Classes/ViewRelated/System/Floating Create Button/SheetActions.swift b/WordPress/Classes/ViewRelated/System/Floating Create Button/SheetActions.swift index 6bbde69070af..d6739d05627f 100644 --- a/WordPress/Classes/ViewRelated/System/Floating Create Button/SheetActions.swift +++ b/WordPress/Classes/ViewRelated/System/Floating Create Button/SheetActions.swift @@ -75,4 +75,8 @@ struct StoryAction: ActionSheetItem { badge.backgroundColor = Constants.Badge.backgroundColor return badge } + + static func shouldBeShown(blog: Blog?) -> Bool { + return (blog?.supports(.stories) ?? false) && !UIDevice.isPad() && !JetpackFeaturesRemovalCoordinator.shouldRemoveJetpackFeatures() + } }