/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ import { LinkMenu } from "content-src/components/LinkMenu/LinkMenu"; import { ContextMenuButton } from "content-src/components/ContextMenu/ContextMenuButton"; import { actionCreators as ac } from "common/Actions.mjs"; import React from "react"; import { connect } from "react-redux"; export class _DSLinkMenu extends React.PureComponent { render() { const { index, dispatch } = this.props; let TOP_STORIES_CONTEXT_MENU_OPTIONS; const PREF_REPORT_ADS_ENABLED = "discoverystream.reportAds.enabled"; const prefs = this.props.Prefs.values; const showAdsReporting = prefs[PREF_REPORT_ADS_ENABLED]; const isSpoc = this.props.card_type === "spoc"; if (isSpoc) { TOP_STORIES_CONTEXT_MENU_OPTIONS = [ "BlockUrl", ...(showAdsReporting ? ["ReportAd"] : []), "ManageSponsoredContent", "OurSponsorsAndYourPrivacy", ]; } else { const saveToPocketOptions = this.props.pocket_button_enabled ? ["CheckArchiveFromPocket", "CheckSavedToPocket"] : []; TOP_STORIES_CONTEXT_MENU_OPTIONS = [ "CheckBookmark", ...saveToPocketOptions, "Separator", "OpenInNewWindow", "OpenInPrivateWindow", "Separator", "BlockUrl", ...(this.props.section ? ["ReportContent"] : []), ]; } const type = this.props.type || "DISCOVERY_STREAM"; const title = this.props.title || this.props.source; return (
); } } export const DSLinkMenu = connect(state => ({ Prefs: state.Prefs, }))(_DSLinkMenu);