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.
Fixes #4724 - Add image editor new feature promotion dialog
- Loading branch information
1 parent
e164e42
commit 3709be0
Showing
5 changed files
with
157 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,56 @@ | ||
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) { | ||
return <div id="promo-dialog-panel" className="promo-panel" > | ||
<div className={`${this.props.promoType} promo-box default-color-scheme`}> | ||
<a className="box-close" aria-label="Close Notification" onClick={this.closePanel.bind(this)}></a> | ||
<Localized id="promoTitle"> | ||
<span className="title">Take Note!</span> | ||
</Localized> | ||
<Localized id="promoMessage"> | ||
<p className="message"> | ||
Updated editing tools let you crop, highlight, and even add text to your shot. | ||
</p> | ||
</Localized> | ||
<span className="promo-star"></span> | ||
<Localized id="promoLink"> | ||
<a id="promo-link" aria-label="Try Edit Link" className="message link" onClick={this.closePanel.bind(this)}> | ||
Give it a try | ||
</a> | ||
</Localized> | ||
<span className="promo-star"></span> | ||
</div> | ||
</div>; | ||
} | ||
return null; | ||
} | ||
|
||
componentDidUpdate() { | ||
if (this.props.display) { | ||
this.props.promoOpen(this.props.promoType); | ||
} | ||
} | ||
|
||
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