forked from mozilla-services/screenshots
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes mozilla-services#4724 - Add image editor new feature promotion …
…dialog
- Loading branch information
1 parent
e164e42
commit 8ba41ae
Showing
5 changed files
with
153 additions
and
0 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
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,49 @@ | ||
const React = require("react"); | ||
const PropTypes = require("prop-types"); | ||
const { Localized } = require("fluent-react/compat"); | ||
const sendEvent = require("./browser-send-event.js"); | ||
|
||
exports.PromoDialog = class PromoDialog extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
if (this.props.display) { | ||
this.props.promoOpen(this.props.promoType); | ||
return <div id="promo-dialog-panel" className="promo-panel" > | ||
<div className={`${this.props.promoType} promo-box default-color-scheme`}> | ||
<a className="box-close" onClick={this.closePanel.bind(this)}></a> | ||
<span className="title"></span> | ||
<Localized id="promoMessage"> | ||
<p className="message"> | ||
We have improved the Image Editor! | ||
</p> | ||
</Localized> | ||
<span className="promo-star"></span> | ||
<Localized id="promoLink"> | ||
<span id="promo-link" className="message link" onClick={this.closePanel.bind(this)}> | ||
Give it a try | ||
</span> | ||
</Localized> | ||
<span className="promo-star"></span> | ||
</div> | ||
</div>; | ||
} | ||
return null; | ||
} | ||
|
||
closePanel(event) { | ||
const shouldDisplay = false; | ||
const isLink = event.target.id === "promo-link"; | ||
this.props.promoClose(shouldDisplay, isLink, this.props.promoType); | ||
sendEvent("promo-closed"); | ||
} | ||
}; | ||
|
||
exports.PromoDialog.propTypes = { | ||
display: PropTypes.bool, | ||
promoClose: PropTypes.func, | ||
promoOpen: PropTypes.func, | ||
promoType: PropTypes.string | ||
}; |
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