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-2070: Main screen promotion box #551

Merged
merged 53 commits into from Jun 15, 2020
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
901c4fa
Show premium subscribers a premium badge in simple/detailed views, he…
benstrumeyer May 7, 2020
f944c6c
Use api version 2.1.0 to get multiple subscriptions
benstrumeyer May 7, 2020
e035e69
Add hover effect for premium icon in menu
benstrumeyer May 7, 2020
659749b
Use css as single source of truth for icon colors
benstrumeyer May 7, 2020
2a83d42
Handle case where a user has multiple subscriptions and display Premi…
benstrumeyer May 7, 2020
de02e6c
Display subscription name
benstrumeyer May 8, 2020
53378f0
Remove duplicate locale string
benstrumeyer May 8, 2020
a10bd6c
Handle case where user only has a premium subscription and clicks the…
benstrumeyer May 8, 2020
7e552d2
Refactor code
benstrumeyer May 8, 2020
eb43832
Merge branch 'develop' into GH-2048
benstrumeyer May 8, 2020
9eb39bd
Refactor subscriber badge css classes, image paths and comments
benstrumeyer May 11, 2020
2d2aa90
Fix account#getUserSubscriptionData behavior
benstrumeyer May 11, 2020
9383ab6
Add subscriptionsPremium property to user object to check if a user h…
benstrumeyer May 11, 2020
f7b36a9
Refactor Header component to use subscriptionsPremium property
benstrumeyer May 11, 2020
f545e7b
Add newline
benstrumeyer May 11, 2020
2fcc862
Refactor svg template literal
benstrumeyer May 11, 2020
ef91547
Refactor account#getUserSubscriptionData to return an array of subscr…
benstrumeyer May 12, 2020
4fc3f53
Pass object that allows destructuring of subscriptionData
benstrumeyer May 12, 2020
2a9ffcb
Add return statement after callbacks
benstrumeyer May 12, 2020
f120d4d
Add guard to account#_setSubscriptionData to prevent overriding premi…
benstrumeyer May 12, 2020
7fe5a24
Give user subscriptionsPlus bool if they have either plus or premium …
benstrumeyer May 12, 2020
33c506a
Rename subscriptionsPlus and subscriptionsPremium to plusAccess and p…
benstrumeyer May 12, 2020
0586ff5
Set subscription property on user object with highest tier subscripti…
benstrumeyer May 12, 2020
a77797c
Refactor menu upsell icon to use user.subscriber instead of plusAcces…
benstrumeyer May 12, 2020
1816764
test
benstrumeyer May 12, 2020
0847e49
Refactor Header logo and menu icon to use subscription instead of pre…
benstrumeyer May 13, 2020
d25d313
Rename subscriber variable to subscription
benstrumeyer May 13, 2020
c9ad1de
Refactor subscriber badge to use plusAccess and premiumAccess on clic…
benstrumeyer May 13, 2020
6398be1
Check if user object exists before accessing subscription property
benstrumeyer May 13, 2020
eb337bc
Display UI elements basedd off user scope
benstrumeyer May 13, 2020
3d51fd0
Remove unused subscription property on user
benstrumeyer May 13, 2020
23e5eb7
Base menu icon off of plusAccess and premiumAccess
benstrumeyer May 13, 2020
49eb749
Refactor isPlus to hasPlusAccess, destructure some things, and save s…
benstrumeyer May 13, 2020
47f1cd5
Use panel#hasPlusAccess() directly
benstrumeyer May 13, 2020
ead0930
Fix menu icon link
benstrumeyer May 14, 2020
cf73693
Add description and button for upgrade prompt
benstrumeyer May 15, 2020
01e96c8
Add shield icon without color params
benstrumeyer May 18, 2020
dd113ce
Add url-friendly-params to shield icon
benstrumeyer May 18, 2020
4bd057b
Add responsive styles for upgrade promo
benstrumeyer May 18, 2020
9e2774c
Merge branch 'GH-2048' into GH-2070
benstrumeyer May 18, 2020
c8c4606
Add purple border for non-premium users
benstrumeyer May 18, 2020
b4f891e
Update snapshot
benstrumeyer May 18, 2020
e992df0
Fix button from leaking outside the container right before hitting br…
benstrumeyer May 18, 2020
d44147f
Refactor colors
benstrumeyer May 18, 2020
5b22311
Small style changes
benstrumeyer May 18, 2020
5406aaf
Fix responsive styling for button when logged into a premium account
benstrumeyer May 19, 2020
03bdff3
Change copy
benstrumeyer May 19, 2020
16da3e8
Merge branch 'GH-2070' of github.com:ghostery/ghostery-extension into…
benstrumeyer Jun 15, 2020
f380b59
Fix passing wrong prop
benstrumeyer Jun 15, 2020
0fcce0f
Merge branch 'develop' into GH-2070
christophertino Jun 15, 2020
f060857
Update tests and snapshot
benstrumeyer Jun 15, 2020
9902d6e
Merge branch 'GH-2070' of github.com:ghostery/ghostery-extension into…
benstrumeyer Jun 15, 2020
01478a5
Merge branch 'develop' into GH-2070
christophertino Jun 15, 2020
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Add purple border for non-premium users

  • Loading branch information
benstrumeyer committed May 18, 2020
commit c8c4606eb92733b2dadc6a65d9164de43b37faaa
@@ -34,7 +34,7 @@ const HomeView = (props) => {
enable_metrics,
changeMetrics,
email,
isPlus,
isPremium
} = props;
const accountHref = globals.ACCOUNT_BASE_URL;

@@ -61,6 +61,9 @@ const HomeView = (props) => {
const setupButtonClassNames = ClassNames('HomeView__featureButton button primary', {
hollow: setup_complete,
});
const upgradeContainerClassNames = ClassNames('HomeView__upgradeContainer row align-center-middle', {
'purple-border': !isPremium
});

return (
<div className="HomeView row align-center">
@@ -141,14 +144,14 @@ const HomeView = (props) => {
</NavLink>
</div>
</div>
<div className="HomeView__upgrade row align-center-middle">
<div className={upgradeContainerClassNames}>
<div className="HomeView__upgradeIcon" />
<div className="HomeView__upgradeText">
{t('hub_home_plus_upgrade_text')}
</div>
<div className="HomeView__buttonContainer columns flex-container">
<NavLink to="/upgrade" className="HomeView__featureButton button primary">
{isPlus ? t('hub_home_plus_full_protection') : t('hub_home_plus_upgrade_button_text')}
{isPremium ? t('hub_home_plus_full_protection') : t('hub_home_plus_upgrade_button_text')}
</NavLink>
</div>

@@ -166,7 +169,7 @@ HomeView.propTypes = {
enable_metrics: PropTypes.bool.isRequired,
changeMetrics: PropTypes.func.isRequired,
email: PropTypes.string.isRequired,
isPlus: PropTypes.bool.isRequired,
isPremium: PropTypes.bool.isRequired,
};

export default HomeView;
@@ -73,14 +73,17 @@
padding: 0;
background-color: #979797;
}
.HomeView__upgrade {
.HomeView__upgradeContainer {
display: flex;
margin-top: 22px;
padding: 22px 12px;
background-color: #f0f3f4;
box-shadow: 0 0 8px 5px #920094;
border: solid 1.6px #920094;
border-radius: 4px;

&.purple-border {
box-shadow: 0 0 8px 5px #920094;
border: solid 1.6px #920094;
}
This conversation was marked as resolved by wlycdgr
Comment on lines +84 to +86

This comment has been minimized.

@wlycdgr

wlycdgr May 18, 2020
Member

Let's use the $dark-magenta variable defined in _colors.scss. If you feel like converting the rest of this file to use the other predefined _colors.scss variables while you're at it, I certainly won't stop you.

This comment has been minimized.

@wlycdgr

wlycdgr May 18, 2020
Member

I am not sure why this stylesheet wasn't already using the variables - they should be available as they get pulled in through settings_hub in hub.scss.

This comment has been minimized.

@benstrumeyer

benstrumeyer May 18, 2020
Author Contributor

Definitely should be using color variables--updated!

}
.HomeView__upgradeIcon {
background-image: upgradeShieldIcon(#DAF4FF, #4a4a4a);
@@ -150,7 +153,7 @@
.HomeView__onboardingFeature.feature-setup-complete {
margin: 35px 0 15px;
}
.HomeView__upgrade {
.HomeView__upgradeContainer {
flex-direction: column;
}
.HomeView__upgradeIcon {
@@ -121,22 +121,22 @@ class HomeViewContainer extends Component {
enable_metrics,
changeMetrics: this._handleToggleMetrics,
email: user ? user.email : '',
isPlus,
isPremium,
};

const showPromoModal = !premium_promo_modal_shown && !isPremium;

return (
<div className="full-height">
{/* <PromoModal
<PromoModal
type={PREMIUM}
show={showPromoModal}
isPlus={isPlus}
location="hub"
handleKeepBasicClick={this._handleKeepBasicClick}
handleGetPlusClick={this._handleGetPlusClick}
handleTryMidnightClick={this._handleTryMidnightClick}
/> */}
/>
<HomeView {...childProps} />
</div>
);
ProTip! Use n and p to navigate between commits in a pull request.