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-1969, GH-2029 Plus & Premium In App Promo's #529

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d7a2d6d
Design spring-plus promo modal
benstrumeyer Mar 5, 2020
95280ff
Add click events to promo modal
benstrumeyer Mar 9, 2020
887f445
Remove comments and console.logs
benstrumeyer Mar 9, 2020
c14cf55
Add translations
benstrumeyer Mar 9, 2020
6301df3
Unfinished PromoModal superclass
benstrumeyer Mar 31, 2020
bedad10
Add base class for promo modals
benstrumeyer Apr 1, 2020
04a9760
Insights promo modal broken
benstrumeyer Apr 1, 2020
31121c1
Fix handlePromoXClick, comment in PromoModal structure
Eden12345 Apr 2, 2020
2b54972
Merge insights, plus, and premium PromoModal methods
benstrumeyer Apr 6, 2020
70c9fa1
Fix error
benstrumeyer Apr 7, 2020
56d0716
Refactor X button out to PromoModal.jsx. Move Insights and Plus Promo…
benstrumeyer Apr 7, 2020
4f187af
Fix imports and remove debug flag from manifest.json
benstrumeyer Apr 7, 2020
ea8f83f
Use React.Fragment, update class names, factor out repeat code, updat…
Eden12345 Apr 8, 2020
e3140f5
Update InsightsPromoModal class name and fix display
Eden12345 Apr 8, 2020
121cafb
Merge branch 'develop' into GH-1969/plus-in-app-promo
benstrumeyer Apr 15, 2020
406fec5
Fix premium promo modal in hub. Refactor promo modal pings. Style mod…
benstrumeyer Apr 16, 2020
e6771a4
Merge branch 'develop' into GH-1969/plus-in-app-promo
benstrumeyer Apr 16, 2020
16ed0d1
Merge branch 'develop' into GH-1969/plus-in-app-promo
benstrumeyer Apr 16, 2020
3f8f5dd
Change Spring has sprung to Spring is here. Clear them when logging out
benstrumeyer Apr 22, 2020
5e8dd16
Change Plus promo modal copy
benstrumeyer Apr 22, 2020
e771e4f
Remove $2 price tag from Plus Promo
benstrumeyer Apr 24, 2020
6606256
Remove $14 price tag from Premium Promo
benstrumeyer Apr 24, 2020
72df836
Merge branch 'develop' into GH-1969/plus-in-app-promo
benstrumeyer Apr 24, 2020
73d08e3
Remove testing code
benstrumeyer Apr 24, 2020
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next
Design spring-plus promo modal
  • Loading branch information
benstrumeyer committed Mar 5, 2020
commit d7a2d6de51d0dde4b4bcb38e5fb96c0a5d32a4df
@@ -2349,6 +2349,9 @@
"seven_day_free_trial": {
"message": "7 Day Free Trial ($14/mo)"
},
"spring_has_sprung": {
"message": "Spring has sprung!"
},
"full_coverage_protection_promise": {
"message": "Get full-coverage protection across all browsers & apps on your device"
},

Large diffs are not rendered by default.

@@ -14,6 +14,7 @@

import React from 'react';
import PropTypes from 'prop-types';
import ClassNames from 'classnames';

/**
* A Functional React component for a Exit Button
@@ -22,19 +23,30 @@ import PropTypes from 'prop-types';
*/
const ModalExitButton = (props) => {
const {
toggleModal
toggleModal,
border
} = props;

const borderClassNames = ClassNames('ModalExitButton__exit flex-container align-middle', {
'spring-green': border === 'spring-green'
});

return (
<button type="button" onClick={toggleModal} className="ModalExitButton__exit flex-container align-middle">
<button type="button" onClick={toggleModal} className={borderClassNames}>
<span className="ModalExitButton__exitIcon" />
</button>
);
};

// PropTypes ensure we pass required props of the correct type
ModalExitButton.propTypes = {
toggleModal: PropTypes.func.isRequired
toggleModal: PropTypes.func.isRequired,
border: PropTypes.string,
};

// Default props used in the App
ModalExitButton.defaultProps = {
border: 'grey'
};

export default ModalExitButton;
@@ -16,6 +16,7 @@ import { NavLink } from 'react-router-dom';
import Header from '../containers/HeaderContainer';
import { PremiumPromoModal } from '../../shared-components';
import InsightsPromoModal from './InsightsPromoModal';
import PlusPromoModal from './PlusPromoModal';
import { DynamicUIPortContext } from '../contexts/DynamicUIPortContext';
import { sendMessage } from '../utils/msg';
import { setTheme } from '../utils/utils';
@@ -373,29 +374,57 @@ class Panel extends React.Component {
);
}

/**
* @returns {null|JSX}
* @private
* Renders the Insights promo modal if the user is not already an Insights subscriber
*/
_renderPlusPromoModal = () => {
// if (this._plusSubscriber()) return null;
if (this._plusSubscriber()) {
console.log('test');
}

// sendMessage('promoModals.sawPlusPromo', {});

// sendMessage('ping', 'promo_modals_show_plus');

return (
<PlusPromoModal
handleGoAwayClick={this._handlePromoGoAwayClick}
handleSignInClick={this._handlePromoSignInClick}
handleSubscribeClick={this._handlePromoSubscribeClick}
handleXClick={this._handlePromoXClick}
show
/>
);
}

_renderPromoModal = () => this._renderPlusPromoModal();

/**
* @returns {null|JSX}
* @private
* Renders either the Insights or the Premium promo modal
*/
_renderPromoModal = () => {
const {
promoModal,
isPromoModalHidden,
} = this.props;
// _renderPromoModal = () => {
// const {
// promoModal,
// isPromoModalHidden,
// } = this.props;

if (isPromoModalHidden) return null;
// if (isPromoModalHidden) return null;

if (promoModal === 'insights') {
return this._renderInsightsPromoModal();
}
// if (promoModal === 'insights') {
// return this._renderInsightsPromoModal();
// }

if (promoModal === 'premium') {
return this._renderPremiumPromoModal();
}
// if (promoModal === 'premium') {
// return this._renderPremiumPromoModal();
// }

return null;
}
// return null;
// }

/**
* React's required render function. Returns JSX
@@ -0,0 +1,94 @@
/**
* PlusPromo Modal Component
*
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2019 Ghostery, Inc. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import PropTypes from 'prop-types';
import ClassNames from 'classnames';
import Modal from '../../shared-components/Modal';
import ModalExitButton from './BuildingBlocks/ModalExitButton';

/**
* A functional React component for a PlusPromo Modal that may be displayed in the Hub and/or Panel
* @return {JSX} JSX for rendering a PlusPromo Modal
* @memberof SharedComponents
*/
const PlusPromoModal = (props) => {
const {
show,
location,
isPlus,
handleTryMidnightClick,
handleGetPlusClick,
handleKeepBasicClick,
handleGoAwayClick,
handleXClick,
} = props;

const contentClassNames = ClassNames(
'PlusPromoModal__content',
'flex-container',
'flex-dir-column',
'align-middle',
);

return (
<Modal show={show}>
<div className={contentClassNames}>
<ModalExitButton className="PlusPromoModal__exitButton" toggleModal={handleXClick} border="spring-green" />
<div className="PlusPromoModal__plus-logo" />
<div className="PlusPromoModal__main-content-container">
<div className="PlusPromoModal__header">
<div className="title">
<div>Spring has sprung!</div>
</div>
<div className="description">
<div>Support us and unlock a new spring theme, personal tracking insights, and other special perks by upgrading to Ghostery Plus for $2 per month.</div>
</div>
</div>
</div>
<div className="PlusPromoModal__call-to-action-container">
<div className="PlusPromoModal__button-container flex-container align-center">
<button type="button" className="PlusPromoModal__download-button" onClick={handleTryMidnightClick}>
<span>UPGRADE TO PLUS</span>
</button>
</div>
<div className="flex-container align-justify">
<span className="PlusPromoModal__link">Already a plus subscriber?</span>
<span className="PlusPromoModal__link">{t('no_thanks_turn_promos_off')}</span>
</div>
</div>
</div>
</Modal>
);
};


// PropTypes ensure we pass required props of the correct type
// PlusPromoModal.propTypes = {
// show: PropTypes.bool.isRequired,
// isPlus: PropTypes.bool.isRequired,
// handleTryMidnightClick: PropTypes.func.isRequired,
// handleGetPlusClick: PropTypes.func.isRequired,
// handleKeepBasicClick: PropTypes.func,
// handleGoAwayClick: PropTypes.func,
// handleXClick: PropTypes.func,
// };

// const noop = () => {};
// PlusPromoModal.defaultProps = {
// handleKeepBasicClick: noop,
// handleGoAwayClick: noop,
// handleXClick: noop,
// };

export default PlusPromoModal;
@@ -76,6 +76,7 @@ html body {
@import './partials/_stats_graph';
@import './partials/_modal_exit_button';
@import './partials/insights_promo_modal.scss';
@import './partials/plus_promo_modal.scss';

// Imports from ../shared-components directory
@import '../shared-components/Modal/Modal.scss';
@@ -39,6 +39,9 @@ $link-blue: #2092BF; //primary-color
$button-primary: #3AA2CF;
$dark-cyan-blue: #325e97; //insights modal border

/* GREENS */
$spring-green: #6aa103;

/* MARKETING COLORS */
$red: #E74055;
$purple: #720174;
@@ -19,9 +19,14 @@
width: 26px;
height: 26px;
border-radius: 15px;
border: solid 0.8px #325e97;
background-color: #f7f7f7;
@include transition(background-color 0.2s);
&.grey {
border: solid 0.8px #325e97;
}
&.spring-green {
border: solid 2px $spring-green;
}
}
.ModalExitButton__exit:hover {
background-color: #efefef;
ProTip! Use n and p to navigate between commits in a pull request.