Skip to content

Commit

Permalink
Plans: Clarify discount is for first year
Browse files Browse the repository at this point in the history
Adds a popover for discounted plans for each plan. The plan
header now shows additional information about the length of the
promotion, based on whether it’s a discounted plan or not.

Fixes #10467.
  • Loading branch information
obenland committed Jan 13, 2017
1 parent 727196f commit 9f40c16
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 12 additions & 2 deletions client/my-sites/plan-features/header.jsx
Expand Up @@ -11,6 +11,8 @@ import { connect } from 'react-redux';
**/
import { localize } from 'i18n-calypso';
import Gridicon from 'components/gridicon';
import InfoPopover from 'components/info-popover';
import { isMobile } from 'lib/viewport';
import Ribbon from 'components/ribbon';
import PlanPrice from 'my-sites/plan-price';
import {
Expand Down Expand Up @@ -73,7 +75,8 @@ class PlanFeaturesHeader extends Component {
billingTimeFrame,
discountPrice,
isPlaceholder,
site
site,
translate,
} = this.props;
const isDiscounted = !! discountPrice;
const timeframeClasses = classNames( 'plan-features__header-timeframe', {
Expand All @@ -83,8 +86,15 @@ class PlanFeaturesHeader extends Component {

if ( ! site.jetpack || this.props.planType === PLAN_JETPACK_FREE ) {
return (
<p className={ timeframeClasses } >
<p className={ timeframeClasses }>
{ ! isPlaceholder ? billingTimeFrame : '' }
{ isDiscounted && ! isPlaceholder &&
<InfoPopover
className="plan-features__header-tip-info"
position={ isMobile() ? 'top' : 'right' }>
{ translate( 'Discount for first year' ) }
</InfoPopover>
}
</p>
);
}
Expand Down
6 changes: 6 additions & 0 deletions client/my-sites/plan-features/style.scss
Expand Up @@ -277,6 +277,12 @@ $plan-features-sidebar-width: 272px;
}
}

.plan-features__header-tip-info svg {
padding: 0 3px;
position: absolute;
transform: translateY( -33% );
}

.plan-features__price {
&.is-placeholder {
@include placeholder( 23% );
Expand Down

0 comments on commit 9f40c16

Please sign in to comment.