Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Move report abuse link to the footer. (#4687) (#4842)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba authored and jaredhirsch committed Sep 13, 2018
1 parent 20a7b6b commit ad2d174
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
4 changes: 2 additions & 2 deletions locales/en-US/server.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down
18 changes: 17 additions & 1 deletion server/src/footer-view.js
Original file line number Diff line number Diff line change
@@ -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 (
<div className="footer">
Expand All @@ -17,6 +22,15 @@ exports.Footer = class Footer extends React.Component {
<Localized id="footerLinkFaqs">
<a href="https://support.mozilla.org/kb/firefox-screenshots" target="_blank" rel="noopener noreferrer">FAQs</a>
</Localized>
{
this.props.isOwner ? null
: <Localized id="footerReportShot">
<a href={`https://qsurvey.mozilla.com/s3/screenshots-flagged-shots?ref=${this.props.id}`}
title="Report this shot for abuse, spam, or other problems"
target="_blank" rel="noopener noreferrer"
onClick={this.onReportShot.bind(this)}>Report Shot</a>
</Localized>
}
<Localized id="footerLinkDMCA">
<a href="https://www.mozilla.org/about/legal/report-infringement/" target="_blank" rel="noopener noreferrer">Report IP Infringement</a>
</Localized>
Expand All @@ -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,
};
11 changes: 3 additions & 8 deletions server/src/pages/shot/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? <div className="edit-highlight" onClick={ this.onClickEdit.bind(this) } onMouseOver={ this.onMouseOverHighlight.bind(this) } onMouseOut={ this.onMouseOutHighlight.bind(this) }></div> : null;

const activeFavClass = this.props.expireTime ? "" : "is-fav";
Expand All @@ -378,11 +378,6 @@ class Body extends React.Component {
</Localized>
<PromoDialog promoClose={this.promoClose.bind(this)} display={this.state.promoDialog} />
</div>;
} else {
trashOrFlagButton = <Localized id="shotPageAbuseButton">
<button className="button transparent flag" title="Report this shot for abuse, spam, or other problems" onClick={ this.onClickFlag.bind(this) }></button>
</Localized>;
editButton = null;
}

let myShotsHref = "/shots";
Expand Down Expand Up @@ -463,7 +458,7 @@ class Body extends React.Component {
{ errorMessages }
{ clips }
</section>
<Footer forUrl={ shot.viewUrl } {...this.props} />
<Footer {...this.props} />
</div>
</reactruntime.BodyTemplate>);
}
Expand Down

0 comments on commit ad2d174

Please sign in to comment.