Skip to content

Commit

Permalink
Jetpack Onboarding: Save site type selection (#21154)
Browse files Browse the repository at this point in the history
* Jetpack Onboarding: Save site type selection

* Jetpack Onboarding: Simplify handleSiteTypeSelection
  • Loading branch information
tyxla authored Jan 4, 2018
1 parent 3a8a227 commit 0298506
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions client/jetpack-onboarding/steps/site-type.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* External dependencies
*/
import React from 'react';
import { connect } from 'react-redux';
import { localize } from 'i18n-calypso';

/**
Expand All @@ -15,12 +16,20 @@ import PageViewTracker from 'lib/analytics/page-view-tracker';
import Tile from 'components/tile-grid/tile';
import TileGrid from 'components/tile-grid';
import { JETPACK_ONBOARDING_STEPS as STEPS } from '../constants';
import { saveJetpackOnboardingSettings } from 'state/jetpack-onboarding/actions';

class JetpackOnboardingSiteTypeStep extends React.PureComponent {
handleSiteTypeSelection = siteType => () => {
this.props.saveJetpackOnboardingSettings( this.props.siteId, {
siteType,
} );
};

render() {
const { translate } = this.props;
const { getForwardUrl, translate } = this.props;
const headerText = translate( "Let's shape your new site." );
const subHeaderText = translate( 'What kind of site do you need? Choose an option below:' );
const forwardUrl = getForwardUrl();

return (
<div className="steps__main">
Expand All @@ -39,18 +48,24 @@ class JetpackOnboardingSiteTypeStep extends React.PureComponent {
'To share your ideas, stories, photographs, or creative projects with your followers.'
) }
image={ '/calypso/images/illustrations/type-personal.svg' }
href={ forwardUrl }
onClick={ this.handleSiteTypeSelection( 'personal' ) }
/>
<Tile
buttonLabel={ translate( 'Business site' ) }
description={ translate(
'To promote your business, organization, or brand, sell products or services, or connect with your audience.'
) }
image={ '/calypso/images/illustrations/type-business.svg' }
href={ forwardUrl }
onClick={ this.handleSiteTypeSelection( 'business' ) }
/>
</TileGrid>
</div>
);
}
}

export default localize( JetpackOnboardingSiteTypeStep );
export default connect( null, { saveJetpackOnboardingSettings } )(
localize( JetpackOnboardingSiteTypeStep )
);

0 comments on commit 0298506

Please sign in to comment.