Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-1895, GH-1896, and GH-1899: Premium promo ux update and telemetry #486

Merged
merged 3 commits into from Dec 16, 2019
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next

Set debug and log for testing promos. Do not show Plus subscribe link…

… in promo if user is a Plus subscriber.
  • Loading branch information
wlycdgr committed Dec 12, 2019
commit fabae81cf2066cc86de37463a8cc4a0f34a6d6fe
@@ -139,6 +139,7 @@ class HomeViewContainer extends Component {
<div className="full-height">
<PremiumPromoModal
show={showPromoModal}
isPlus={isPlus}
location="hub"
handleKeepBasicClick={this._handleKeepBasicClick}
handleGetPlusClick={this._handleGetPlusClick}
@@ -315,6 +315,17 @@ class Panel extends React.Component {
return loggedIn && (user && user.scopes && user.scopes.includes('subscriptions:premium'));
}

/**
* @returns {bool}
* @private
* Is the user a Plus subscriber?
*/
_plusSubscriber = () => {
const { loggedIn, user } = this.props;

return loggedIn && (user && user.subscriptionsPlus);
}

/**
* @returns {JSX}
* @private
@@ -325,9 +336,12 @@ class Panel extends React.Component {

sendMessage('promoModals.sawPremiumPromo', {});

const isPlus = this._plusSubscriber();

return (
<PremiumPromoModal
show
isPlus={isPlus}
location="panel"
handleGoAwayClick={this._handlePromoGoAwayClick}
handleGetPlusClick={this._handlePromoGetPlusClick}
@@ -26,6 +26,7 @@ const PremiumPromoModal = (props) => {
const {
show,
location,
isPlus,
handleTryMidnightClick,
handleGetPlusClick,
handleKeepBasicClick,
@@ -97,9 +98,11 @@ const PremiumPromoModal = (props) => {
</div>
</div>
<div className="PremiumPromoModal__text-link-container">
<div onClick={handleGetPlusClick} className="PremiumPromoModal__text-link">
{t('support_ghostery_for_2_instead')}
</div>
{!isPlus && (
<div onClick={handleGetPlusClick} className="PremiumPromoModal__text-link">
{t('support_ghostery_for_2_instead')}
</div>
)}
{isInHub && (
<div onClick={handleKeepBasicClick} className="PremiumPromoModal__text-link">
{t('no_thanks_continue_with_basic')}
@@ -122,6 +125,7 @@ const PremiumPromoModal = (props) => {
PremiumPromoModal.propTypes = {
show: PropTypes.bool.isRequired,
location: PropTypes.string.isRequired,
isPlus: PropTypes.bool.isRequired,
handleTryMidnightClick: PropTypes.func.isRequired,
handleGetPlusClick: PropTypes.func.isRequired,
handleKeepBasicClick: PropTypes.func,
@@ -151,7 +151,7 @@ $condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helveti

.PremiumPromoModal__text-link-container {
display: flex;
justify-content: space-between;
justify-content: space-evenly;
}

.PremiumPromoModal__text-link {
@@ -6,6 +6,8 @@
"strict_min_version": "52.0"
}
},
"debug": true,
"log": true,
"author": "Ghostery",
"name": "__MSG_name__",
"short_name": "Ghostery",
ProTip! Use n and p to navigate between commits in a pull request.