From ad2d1745d48ef5b4afbe79fae7fade474ce3d062 Mon Sep 17 00:00:00 2001 From: Barry Chen Date: Thu, 13 Sep 2018 14:04:31 -0500 Subject: [PATCH] Move report abuse link to the footer. (#4687) (#4842) --- locales/en-US/server.ftl | 4 ++-- server/src/footer-view.js | 18 +++++++++++++++++- server/src/pages/shot/view.js | 11 +++-------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/locales/en-US/server.ftl b/locales/en-US/server.ftl index 7428c125ac..269736918a 100644 --- a/locales/en-US/server.ftl +++ b/locales/en-US/server.ftl @@ -22,6 +22,8 @@ settingsButton = footerLinkMozilla = Mozilla footerLinkTerms = Terms footerLinkPrivacy = Privacy Notice +footerReportShot = Report Shot + .title = Report this shot for abuse, spam, or other problems footerLinkFaqs = FAQs footerLinkDMCA = Report IP Infringement footerLinkDiscourse = Give Feedback @@ -117,8 +119,6 @@ shotPageExpiredMessage = This shot has expired. shotPageExpiredMessageDetails = Here is the page it was originally created from: shotPageDeleteButton = .title = Delete this shot -shotPageAbuseButton = - .title = Report this shot for abuse, spam, or other problems shotPageDownloadShot = .title = Download shotPageEditButton = diff --git a/server/src/footer-view.js b/server/src/footer-view.js index 52292e29ae..33b502ee20 100644 --- a/server/src/footer-view.js +++ b/server/src/footer-view.js @@ -1,8 +1,13 @@ const React = require("react"); const { Localized } = require("fluent-react/compat"); const PropTypes = require("prop-types"); +const sendEvent = require("./browser-send-event.js"); exports.Footer = class Footer extends React.Component { + onReportShot() { + sendEvent("start-flag", "navbar", {useBeacon: true}); + } + render() { return (
@@ -17,6 +22,15 @@ exports.Footer = class Footer extends React.Component { FAQs + { + this.props.isOwner ? null + : + Report Shot + + } Report IP Infringement @@ -32,5 +46,7 @@ exports.Footer = class Footer extends React.Component { }; exports.Footer.propTypes = { - authenticated: PropTypes.bool + id: PropTypes.string, + isOwner: PropTypes.bool, + authenticated: PropTypes.bool, }; diff --git a/server/src/pages/shot/view.js b/server/src/pages/shot/view.js index 6725bbc261..a8e3a2c027 100644 --- a/server/src/pages/shot/view.js +++ b/server/src/pages/shot/view.js @@ -354,8 +354,8 @@ class Body extends React.Component { } let favoriteShotButton = null; - let trashOrFlagButton; - let editButton; + let trashOrFlagButton = null; + let editButton = null; const highlight = this.state.highlightEditButton ?
: null; const activeFavClass = this.props.expireTime ? "" : "is-fav"; @@ -378,11 +378,6 @@ class Body extends React.Component {
; - } else { - trashOrFlagButton = - - ; - editButton = null; } let myShotsHref = "/shots"; @@ -463,7 +458,7 @@ class Body extends React.Component { { errorMessages } { clips } -