From 0c4d68ae307316d05d58e382f4beba120380efc9 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Mon, 7 Mar 2022 17:45:45 -0800 Subject: [PATCH] create feature flag for showing menu options on link item detail view --- .../App/Views/LinkItemDetailView.swift | 38 ++++++++++--------- .../Sources/Utils/FeatureFlags.swift | 1 + 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift b/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift index 337426600..d6f276e69 100644 --- a/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/LinkItemDetailView.swift @@ -169,25 +169,27 @@ struct LinkItemDetailView: View { ) .padding(.horizontal) .scaleEffect(navBarVisibilityRatio) - Menu( - content: { - Group { - Button( - action: {}, - label: { Label("Archive", systemImage: "archivebox") } - ) - Button( - action: {}, - label: { Label("Delete Link", systemImage: "trash") } - ) + if FeatureFlag.showLinkOptionsOnReaderView { + Menu( + content: { + Group { + Button( + action: {}, + label: { Label("Archive", systemImage: "archivebox") } + ) + Button( + action: {}, + label: { Label("Delete Link", systemImage: "trash") } + ) + } + }, + label: { + Image.profile + .padding(.horizontal) + .scaleEffect(navBarVisibilityRatio) } - }, - label: { - Image.profile - .padding(.horizontal) - .scaleEffect(navBarVisibilityRatio) - } - ) + ) + } } .frame(height: readerViewNavBarHeight * navBarVisibilityRatio) .opacity(navBarVisibilityRatio) diff --git a/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift b/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift index 67a1faf37..a5a911bd4 100644 --- a/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift +++ b/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift @@ -15,4 +15,5 @@ public enum FeatureFlag { public static let enableShareButton = false public static let enableSnooze = false public static let showFeedItemTags = false + public static let showLinkOptionsOnReaderView = false }