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

Use React.Fragment, update class names, factor out repeat code, updat…
…e lint file
  • Loading branch information
Eden12345 committed Apr 8, 2020
commit ea8f83f89e16b2a94c581bcef53da2041c40fdc9
@@ -83,6 +83,7 @@ module.exports = {
'react/no-access-state-in-setstate': [0], // TODO: enable this check
'react/no-danger': [0],
'react/prop-types': [0],
'react/jsx-fragments': [1, 'element'],
'react/sort-comp': [2, {
order: [
"static-variables",
@@ -11,7 +11,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import React, { Fragment } from 'react';
import ClassNames from 'classnames';
import { Route } from 'react-router-dom';
import { ToggleSlider } from './BuildingBlocks';
@@ -266,7 +266,7 @@ class Rewards extends React.Component {
const src = chrome.runtime.getURL('cliqz/offers-cc/index.html?cross-origin');
const text = t(`panel_rewards_view__reward${rewardsCount === 1 ? '' : 's'}`);
return (
<>
<Fragment>
{is_expanded && (
<div className="RewardsPanel__rewards_count_wrapper">
<div className="RewardsPanel__rewards_count">{rewardsCount}</div>
@@ -281,7 +281,7 @@ class Rewards extends React.Component {
height={iframeHeight}
title="myoffrz-rewards"
/>
</>
</Fragment>
);
}

@@ -11,7 +11,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import React from 'react';
import React, { Fragment } from 'react';

const InsightsPromoModalContent = (props) => {
const {
@@ -20,56 +20,56 @@ const InsightsPromoModalContent = (props) => {
handleTryInsightsClick,
} = props;
return (
<div className="InsightsModal__container flex-container flex-dir-column align-middle">
<div className="InsightsModal__image" />
<div className="InsightsModal__header">
<Fragment>
<div className="InsightsPromoModal__image" />
<div className="InsightsPromoModal__header">
{t('panel_insights_promotion_header')}
</div>
<div className="InsightsModal__description">
<div className="InsightsPromoModal__description">
{t('panel_insights_promotion_description')}
</div>
<div className="flex-container">
<div className="InsightsModal__features">
<div className="InsightsPromoModal__features">
<div className="flex-container align-middle">
<span className="InsightsModal__checked-circle-icon" />
<div className="InsightsModal__feature-text">
<span className="InsightsPromoModal__checked-circle-icon" />
<div className="InsightsPromoModal__feature-text">
{t('panel_insights_audit_tags')}
</div>
</div>
<div className="flex-container align-middle">
<span className="InsightsModal__checked-circle-icon" />
<div className="InsightsModal__feature-text">
<span className="InsightsPromoModal__checked-circle-icon" />
<div className="InsightsPromoModal__feature-text">
{t('panel_insights_promotion_trace_poor_performance')}
</div>
</div>
</div>
<div className="InsightsModal__features">
<div className="InsightsPromoModal__features">
<div className="flex-container align-middle">
<span className="InsightsModal__checked-circle-icon" />
<div className="InsightsModal__feature-text">
<span className="InsightsPromoModal__checked-circle-icon" />
<div className="InsightsPromoModal__feature-text">
{t('panel_insights_promotion_watch_pings')}
</div>
</div>
<div className="flex-container align-middle">
<span className="InsightsModal__checked-circle-icon" />
<div className="InsightsModal__feature-text">
<span className="InsightsPromoModal__checked-circle-icon" />
<div className="InsightsPromoModal__feature-text">
{t('panel_insights_promotion_explore_trends')}
</div>
</div>
</div>
</div>
<div className="InsightsModal__call-to-action-container">
<div className="InsightsPromoModal__call-to-action-container">
<div className="flex-container align-center">
<span onClick={handleTryInsightsClick} className="btn InsightsModal__call-to-action">
<span onClick={handleTryInsightsClick} className="btn InsightsPromoModal__call-to-action">
<span className="button-text">{t('panel_insights_promotion_call_to_action')}</span>
</span>
</div>
<div className="InsightsModal__other-options-container flex-container align-justify">
<span onClick={handleSignInClick} className="InsightsModal__link">{t('subscribe_pitch_sign_in')}</span>
<span onClick={handleGoAwayClick} className="InsightsModal__link">{t('no_thanks_turn_promos_off')}</span>
<div className="InsightsPromoModal__other-options-container flex-container align-justify">
<span onClick={handleSignInClick} className="InsightsPromoModal__link">{t('subscribe_pitch_sign_in')}</span>
<span onClick={handleGoAwayClick} className="InsightsPromoModal__link">{t('no_thanks_turn_promos_off')}</span>
</div>
</div>
</div>
</Fragment>
);
};

@@ -15,7 +15,7 @@
$standard-font-family: Roboto, "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
$condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

.InsightsModal__content {
.InsightsPromoModal__content {
background-color: $alabaster;
position: relative;
width: 518px;
@@ -26,19 +26,14 @@ $condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helveti
z-index: 10;
}

.InsightsModal__container {
min-height: 450px;
justify-content: space-between;
}

.InsightsModal__image {
.InsightsPromoModal__image {
height: 94px;
width: 177px;
margin-top: 20px;
background-image: url('/app/images/panel/insights-ribbon.svg');
}

.InsightsModal__header {
.InsightsPromoModal__header {
font-family: $standard-font-family;
height: 27.1px;
font-size: 20px;
@@ -48,7 +43,7 @@ $condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helveti
margin-bottom: 10px;
}

.InsightsModal__description {
.InsightsPromoModal__description {
width: 400px;
font-size: 18px;
font-weight: 500;
@@ -57,7 +52,7 @@ $condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helveti
font-family: $standard-font-family;
}

.InsightsModal__features {
.InsightsPromoModal__features {
&:nth-child(odd) {
margin-left: 25px;
width: 50%;
@@ -69,15 +64,15 @@ $condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helveti
}
}

.InsightsModal__feature-text {
.InsightsPromoModal__feature-text {
font-family: $standard-font-family;
font-size: 14px;
color: $medium-gray;
padding-bottom: 5px;
line-height: 16px;
}

.InsightsModal__checked-circle-icon {
.InsightsPromoModal__checked-circle-icon {
flex: none;
height: 18px;
width: 18px;
@@ -86,7 +81,7 @@ $condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helveti
align-self: flex-start;
}

.InsightsModal__call-to-action-container {
.InsightsPromoModal__call-to-action-container {
height: 95px;
width: 99%;
margin-top: 10px;
@@ -96,7 +91,7 @@ $condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helveti
flex-direction: column;
}

.InsightsModal__call-to-action {
.InsightsPromoModal__call-to-action {
cursor: pointer;
display: flex;
justify-content: center;
@@ -116,7 +111,7 @@ $condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helveti
}
}

.InsightsModal__link {
.InsightsPromoModal__link {
font-family: $standard-font-family;
font-size: 13px;
color: $tundora;
@@ -126,7 +121,7 @@ $condensed-font-family: Roboto Condensed, "Open Sans", "Helvetica Neue", Helveti
}
}

.InsightsModal__other-options-container {
.InsightsPromoModal__other-options-container {
margin-top: 10px;
padding: 0 10.5px;
text-decoration: underline;
@@ -118,9 +118,7 @@ class PromoModal extends React.Component {
}

_renderXButton = (type) => {
const XButtonClass = type === PLUS
? 'PlusPromoModal__exitButton'
: 'InsightsModal__exitButton';
const XButtonClass = ClassNames({ PlusPromoModal__exitButton: type === PLUS });

return (
<ModalExitButton
@@ -167,11 +165,16 @@ class PromoModal extends React.Component {

render() {
const { type } = this.props;
const modalContentClassNames = ClassNames('', {
InsightsModal__content: type === INSIGHTS,
PlusPromoModal__content: type === PLUS,
PremiumPromoModal__content: type === PREMIUM,
});
const modalContentClassNames = ClassNames(
'flex-container',
'flex-dir-column',
'align-middle',
{
InsightsModal__content: type === INSIGHTS,
PlusPromoModal__content: type === PLUS,
PremiumPromoModal__content: type === PREMIUM,
}
);
return (
<Modal show>
<div className={modalContentClassNames}>
ProTip! Use n and p to navigate between commits in a pull request.