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

Plans: Add plan features to Plan Overview page #1565

Merged
merged 21 commits into from
Dec 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
014d17e
Plans: Add plan features section to Plan Overview page
stephanethomas Dec 14, 2015
7cb4c12
Plans: Extract plan feature code into dedicated component in Plan Ove…
stephanethomas Dec 14, 2015
a87a94f
Plans: Add remaining features to Plan Overview page
stephanethomas Dec 14, 2015
cf46a83
Plans: Simplify code in plan status section in Plan Overview page
stephanethomas Dec 14, 2015
6e8bd3b
Plans: Move stylesheet of Plan Overview page at the right place
stephanethomas Dec 14, 2015
cff7f9a
Plans: Update Plan Overview page to use template strings for redirects
stephanethomas Dec 14, 2015
3fad72f
Plans: Replacing buttons with onClick events with native links for ac…
scruffian Dec 16, 2015
744f095
Plans: Only show Business features to users in a Business trial
scruffian Dec 16, 2015
a683c54
Plans: Splitting up the CSS into separate files to conform to the cod…
scruffian Dec 16, 2015
bc602be
Plans: Add a minimum width to the buttons so that they line up. Also …
scruffian Dec 16, 2015
044607b
Plans: Refactoring CSS to share code in mixins, so we can keep the co…
scruffian Dec 16, 2015
8b7c1ab
Plans: Upating the font sizes for mobile devices, to make the status …
scruffian Dec 16, 2015
2550ef3
Plans: Move the plan feature component to its own directory
scruffian Dec 16, 2015
f8f19c9
Plans: Avoid mixin by using a list of classes in `PlanOverview`
drewblaisdell Dec 16, 2015
ade5b36
Plans: Rewrite the plan-feature component as a stateless component to…
scruffian Dec 16, 2015
85dd88a
Plans: Link business trial users to `/design/:site` in `PlanFeatures`
drewblaisdell Dec 17, 2015
6f50710
Plans: Replace element selectors with class names
drewblaisdell Dec 17, 2015
da0f835
Plans: Prevent 'Purchase Now' button from overflowing
drewblaisdell Dec 17, 2015
a118680
Plans: Add missing requirement in props validation of Plan Feature co…
stephanethomas Dec 18, 2015
1112d29
Plans: Remove unnecessary span and simplify ternary operation in Plan…
stephanethomas Dec 18, 2015
8ac0528
Plans: Simplify margin rules and increase button width on Plan Overvi…
stephanethomas Dec 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions assets/stylesheets/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
@import 'my-sites/people/people-profile/style';
@import 'my-sites/people/people-notices/style';
@import 'my-sites/plans/style';
@import 'my-sites/plans/plan-overview/style';
@import 'my-sites/plans/plan-overview/plan-feature/style';
@import 'my-sites/plans/plan-overview/plan-status/style';
@import 'my-sites/post/post-image/style';
@import 'my-sites/post-selector/style';
Expand Down
3 changes: 2 additions & 1 deletion client/my-sites/plans/plan-overview/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const PlanOverview = React.createClass( {
plan={ this.props.plan }
selectedSite={ this.props.selectedSite } />

<PlanFeatures />
<PlanFeatures
selectedSite={ this.props.selectedSite } />
</Main>
);
}
Expand Down
40 changes: 40 additions & 0 deletions client/my-sites/plans/plan-overview/plan-feature/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* External dependencies
*/
import React from 'react';

/**
* Internal dependencies
*/
import Button from 'components/button';
import CompactCard from 'components/card/compact';

const PlanFeature = ( { button, description, heading } ) => {
return (
<CompactCard className="plan-feature">
<div>
<strong className="plan-feature__heading">{ heading }</strong>
<span>{ description }</span>
</div>
{ button &&
<Button
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use compact buttons here? I think it will look better given the space and the repetition.

className="plan-feature__button"
href={ button.href }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talking a bit with @breezyskies... can we try a compact button here? I think it'd work a bit better in terms of weight.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to loop back, PR started in #1820 for this.

primary>
{ button.label }
</Button>
}
</CompactCard>
);
};

PlanFeature.propTypes = {
button: React.PropTypes.shape( {
label: React.PropTypes.string.isRequired,
href: React.PropTypes.string.isRequired
} ),
description: React.PropTypes.string.isRequired,
heading: React.PropTypes.string.isRequired
};

export default PlanFeature;
3 changes: 3 additions & 0 deletions client/my-sites/plans/plan-overview/plan-feature/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.plan-feature__heading {
display: block;
}
57 changes: 53 additions & 4 deletions client/my-sites/plans/plan-overview/plan-features/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,66 @@ import React from 'react';
/**
* Internal dependencies
*/
import Card from 'components/card';
import PlanFeature from '../plan-feature'
import SectionHeader from 'components/section-header';
import { isBusiness } from 'lib/products-values';

const PlanFeatures = React.createClass( {
propTypes: {
selectedSite: React.PropTypes.oneOfType( [
React.PropTypes.object,
React.PropTypes.bool
] ).isRequired
},

renderBusinessFeatures() {
return (
<div>
<PlanFeature
button={ { label: this.translate( 'Setup eCommerce' ), href: `/plugins/${ this.props.selectedSite.slug }` } }
description={ this.translate( 'Connect your Shopify, Ecwid, or Gumroad account to your WordPress.com site.' ) }
heading={ this.translate( 'eCommerce Integration' ) } />

<PlanFeature
button={ { label: this.translate( 'Setup Analytics' ), href: `/settings/analytics/${ this.props.selectedSite.slug }` } }
description={ this.translate( 'Connect your Google Analytics account.' ) }
heading={ this.translate( 'Google Analytics Integration' ) } />

<PlanFeature
button={ { label: this.translate( 'View Themes' ), href: `/design/${ this.props.selectedSite.slug }` } }
description={ this.translate( 'You have access to dozens of our best themes available.' ) }
heading={ this.translate( 'Unlimited Premium Themes' ) } />
</div>
);
},

render() {
return (
<div>
<SectionHeader label={ this.translate( "Your Site's Features" ) } />
<Card>
...
</Card>

<PlanFeature
button={ { label: this.translate( 'Customize' ), href: `/customize/${ this.props.selectedSite.slug }` } }
description={ this.translate( "Change your theme's fonts, colors, and CSS for a unique look." ) }
heading={ this.translate( 'Custom Design' ) } />

{ isBusiness( this.props.selectedSite.plan ) && this.renderBusinessFeatures() }

<PlanFeature
description={ this.translate( 'WordPress.com ads will not display on your site.' ) }
heading={ this.translate( 'No Ads' ) } />

<PlanFeature
description={ this.translate( 'You can upload unlimited photos, videos, or music.' ) }
heading={ this.translate( 'Storage Space' ) } />

<PlanFeature
description={ this.translate( 'You can upload and hosts videos on your site without advertising.' ) }
heading={ this.translate( 'VideoPress' ) } />

<PlanFeature
description={ this.translate( 'You can live chat with our happiness engineers anytime you need.' ) }
heading={ this.translate( 'Support' ) } />
</div>
);
}
Expand Down
6 changes: 3 additions & 3 deletions client/my-sites/plans/plan-overview/plan-status/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const PlanStatus = React.createClass( {
purchasePlan() {
upgradesActions.addItem( cartItems.planItem( this.props.plan.productSlug ) );

page( '/checkout/' + this.props.selectedSite.slug );
page( `/checkout/${ this.props.selectedSite.slug }` );
},

render() {
Expand All @@ -51,7 +51,7 @@ const PlanStatus = React.createClass( {
<h1 className="plan-status__plan">
{
this.translate( '%(planName)s Free Trial', {
args: { planName: this.props.plan.productName }
args: { planName: plan.productName }
} )
}
</h1>
Expand All @@ -64,7 +64,7 @@ const PlanStatus = React.createClass( {
</Button>
</CompactCard>

<PlanStatusProgress plan={ this.props.plan } />
<PlanStatusProgress plan={ plan } />
</div>
);
}
Expand Down
35 changes: 13 additions & 22 deletions client/my-sites/plans/plan-overview/plan-status/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
margin-bottom: 30px;
}

.plan-status__info {
align-content: space-between;
align-items: center;
display: flex;
flex-direction: column;
justify-content: space-between;

@include breakpoint( ">480px" ) {
flex-direction: row;
}

&:after {
display: none;
// the nesting here is necessary to override the styles in the `PlanOverview` stylesheet
.plan-overview .plan-status__button.button {
@include breakpoint( "<960px" ) {
margin-left: 0;
min-width: 0;
}
}

Expand All @@ -23,7 +15,7 @@

@include breakpoint( ">480px" ) {
margin-left: 20px;
margin-right: 20px;
margin-right: 10px;
}
}

Expand Down Expand Up @@ -55,16 +47,11 @@
.plan-status__plan {
line-height: 26px;
font-family: Merriweather, Georgia, "Times New Roman", Times, serif;
font-size: 24px;
font-size: 18px;
font-weight: 700;
}

.plan-status__button {
flex-shrink: 0;

@include breakpoint( "<480px" ) {
margin-top: 15px;
width: 100%;
@include breakpoint( ">960px" ) {
font-size: 24px;
}
}

Expand All @@ -85,4 +72,8 @@

.plan-status__time-until-expiry {
font-weight: 700;

@include breakpoint( "<480px" ) {
font-size: 14px;
}
}
36 changes: 36 additions & 0 deletions client/my-sites/plans/plan-overview/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.plan-overview {
.plan-feature__button,
.plan-status__button {
flex-shrink: 0;
min-width: 160px;
text-align: center;

@include breakpoint( "<480px" ) {
margin-top: 15px;
width: 100%;
}

@include breakpoint( ">480px" ) {
margin-left: 15px;
}
}
}

.plan-overview {
.plan-feature,
.plan-status__info {
align-content: space-between;
display: flex;
flex-direction: column;
justify-content: space-between;

@include breakpoint( ">480px" ) {
flex-direction: row;
align-items: center;
}

&:after {
display: none;
}
}
}