diff --git a/app/hub/Views/HomeView/HomeViewContainer.jsx b/app/hub/Views/HomeView/HomeViewContainer.jsx
index c98e55b78..81caf36c6 100644
--- a/app/hub/Views/HomeView/HomeViewContainer.jsx
+++ b/app/hub/Views/HomeView/HomeViewContainer.jsx
@@ -103,21 +103,11 @@ class HomeViewContainer extends Component {
*/
_handleTryMidnightClick = () => { this._handlePremiumPromoModalClick('premium'); }
- /**
- * @returns {bool}
- * @private
- * Is the user a Premium subscriber?
- */
- _premiumSubscriber = () => {
- const { loggedIn, user } = this.props;
-
- return loggedIn && (user && user.scopes && user.scopes.includes('subscriptions:premium'));
- }
-
_render() {
const { justInstalled } = this.state;
const { home, user } = this.props;
- const isPlus = user && user.subscriptionsPlus || false;
+ const isPlus = user && user.plusAccess || false;
+ const isPremium = user && user.premiumAccess || false;
const {
premium_promo_modal_shown,
setup_complete,
@@ -134,7 +124,7 @@ class HomeViewContainer extends Component {
isPlus,
};
- const showPromoModal = !premium_promo_modal_shown && !this._premiumSubscriber();
+ const showPromoModal = !premium_promo_modal_shown && !isPremium;
return (
@@ -174,7 +164,7 @@ HomeViewContainer.propTypes = {
}),
user: PropTypes.shape({
email: PropTypes.string,
- subscriptionsPlus: PropTypes.bool,
+ plusAccess: PropTypes.bool,
}),
actions: PropTypes.shape({
getHomeProps: PropTypes.func.isRequired,
@@ -194,7 +184,7 @@ HomeViewContainer.defaultProps = {
},
user: {
email: '',
- subscriptionsPlus: false,
+ plusAccess: false,
},
};
diff --git a/app/hub/Views/PlusView/PlusViewContainer.jsx b/app/hub/Views/PlusView/PlusViewContainer.jsx
index 5d8332ddc..2737380ec 100644
--- a/app/hub/Views/PlusView/PlusViewContainer.jsx
+++ b/app/hub/Views/PlusView/PlusViewContainer.jsx
@@ -43,8 +43,9 @@ class PlusViewContainer extends Component {
* @return {JSX} JSX for rendering the Plus View of the Hub app
*/
render() {
+ const { user } = this.props;
const childProps = {
- isPlus: this.props.user && this.props.user.subscriptionsPlus || false,
+ isPlus: user && user.plusAccess || false,
onPlusClick: this._sendPlusPing,
};
@@ -56,7 +57,7 @@ class PlusViewContainer extends Component {
PlusViewContainer.propTypes = {
user: PropTypes.shape({
email: PropTypes.string,
- subscriptionsPlus: PropTypes.bool,
+ plusAccess: PropTypes.bool,
}),
actions: PropTypes.shape({
sendPing: PropTypes.func.isRequired,
@@ -68,7 +69,7 @@ PlusViewContainer.propTypes = {
PlusViewContainer.defaultProps = {
user: {
email: false,
- subscriptionsPlus: false,
+ plusAccess: false,
},
};
diff --git a/app/images/panel/gold-plus-icon-expanded-view.svg b/app/images/panel/plus-badge-icon-expanded-view.svg
similarity index 100%
rename from app/images/panel/gold-plus-icon-expanded-view.svg
rename to app/images/panel/plus-badge-icon-expanded-view.svg
diff --git a/app/images/panel/gold-plus-icon.svg b/app/images/panel/plus-badge-icon.svg
similarity index 100%
rename from app/images/panel/gold-plus-icon.svg
rename to app/images/panel/plus-badge-icon.svg
diff --git a/app/images/panel/premium-badge-icon-expanded-view.svg b/app/images/panel/premium-badge-icon-expanded-view.svg
new file mode 100644
index 000000000..1f6390dc0
--- /dev/null
+++ b/app/images/panel/premium-badge-icon-expanded-view.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/images/panel/premium-badge-icon.svg b/app/images/panel/premium-badge-icon.svg
new file mode 100644
index 000000000..292b7a5e1
--- /dev/null
+++ b/app/images/panel/premium-badge-icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/panel/components/Detail.jsx b/app/panel/components/Detail.jsx
index dfb9bf494..3846924d7 100644
--- a/app/panel/components/Detail.jsx
+++ b/app/panel/components/Detail.jsx
@@ -60,13 +60,14 @@ class Detail extends React.Component {
* @return {ReactComponent} ReactComponent instance
*/
render() {
+ const { is_expanded, user, history } = this.props;
const condensedToggleClassNames = ClassNames('condensed-toggle', {
- condensed: this.props.is_expanded,
+ condensed: is_expanded,
});
- const activeTab = this.props.history.location.pathname.includes('rewards') ? 'rewards' : 'blocking';
+ const activeTab = history.location.pathname.includes('rewards') ? 'rewards' : 'blocking';
const contentDetailsClassNames = ClassNames({
- expanded: this.props.is_expanded,
+ expanded: is_expanded,
rewardsView: activeTab === 'rewards',
});
@@ -80,7 +81,7 @@ class Detail extends React.Component {
diff --git a/app/panel/components/Header.jsx b/app/panel/components/Header.jsx
index 5f31d701a..4a2ab5fd7 100644
--- a/app/panel/components/Header.jsx
+++ b/app/panel/components/Header.jsx
@@ -145,12 +145,13 @@ class Header extends React.Component {
return this.props.is_expert ? '/detail/blocking' : '/';
}
- clickUpgradeBannerOrGoldPlusIcon = () => {
+ clickUpgradeBannerOrSubscriberBadgeIcon = () => {
// TODO check whether this is the message we want to be sending now
sendMessage('ping', 'plus_panel_from_badge');
const { user } = this.props;
- const subscriber = user && user.subscriptionsPlus;
- this.props.history.push(subscriber ? '/subscription/info' : `/subscribe/${!!user}`);
+ const hasPlusAccess = user && user.plusAccess;
+ const hasPremiumAccess = user && user.premiumAccess;
+ this.props.history.push(hasPlusAccess || hasPremiumAccess ? '/subscription/info' : `/subscribe/${!!user}`);
}
/**
@@ -176,11 +177,12 @@ class Header extends React.Component {
const tabDetailedClassNames = ClassNames('header-tab', {
active: is_expert,
});
- const subscriber = user && user.subscriptionsPlus;
+ const hasPlusAccess = user && user.plusAccess;
+ const hasPremiumAccess = user && user.premiumAccess;
const accountLogolink = this.generateAccountLogo();
const badgeClasses = ClassNames('columns', 'shrink', {
- 'non-subscriber-badge': !subscriber,
- 'gold-subscriber-badge': subscriber
+ 'non-subscriber-badge': !(hasPlusAccess || hasPremiumAccess),
+ 'subscriber-badge': hasPlusAccess || hasPremiumAccess
});
const simpleTab = (
@@ -216,10 +218,11 @@ class Header extends React.Component {
);
const plusUpgradeBannerOrSubscriberBadgeLogolink = (
-