This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
83bb07a
commit 55cd022
Showing
9 changed files
with
116 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const React = require("react"); | ||
const PropTypes = require("prop-types"); | ||
const { Localized } = require("fluent-react/compat"); | ||
const sendEvent = require("./browser-send-event.js"); | ||
|
||
exports.AdBanner = class AdBanner extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
clickedInstallFirefox() { | ||
sendEvent("click-install-firefox-shot", {useBeacon: true}); | ||
} | ||
|
||
render() { | ||
let bannerContent = null; | ||
|
||
if (this.props.shouldGetFirefox) { | ||
bannerContent = [ | ||
<Localized key="message" id="gScreenshotsDescription"> | ||
<p>Screenshots made simple. Take, save and share screenshots without leaving Firefox.</p> | ||
</Localized>, | ||
<Localized key="upsell" id="shotPageUpsellFirefox"> | ||
<a className="upsellLink" | ||
href="https://www.mozilla.org/firefox/new/?utm_source=screenshots.firefox.com&utm_medium=referral&utm_campaign=screenshots-acquisition&utm_content=from-shot" | ||
onClick={ this.clickedInstallFirefox.bind(this) }>Get Firefox now</a> | ||
</Localized>, | ||
]; | ||
} else if (this.props.isOwner && !this.props.hasFxa) { | ||
bannerContent = <Localized id="bannerMessage"> | ||
<p> | ||
Sign in or sign up to sync shots across devices, save your favorite shots forever. | ||
</p> | ||
</Localized>; | ||
} | ||
|
||
if (bannerContent) { | ||
return <aside className="ad-banner"> | ||
<div className="logo message"> | ||
{bannerContent} | ||
</div> | ||
</aside>; | ||
} | ||
return null; | ||
} | ||
}; | ||
|
||
exports.AdBanner.propTypes = { | ||
isOwner: PropTypes.bool, | ||
hasFxa: PropTypes.bool, | ||
shouldGetFirefox: PropTypes.bool, | ||
}; | ||
|
||
exports.AdBanner.defaultProps = { | ||
shouldGetFirefox: false, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.