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

Jetpack Onboarding: Save site type selection #21154

Merged
merged 2 commits into from
Jan 4, 2018
Merged
Changes from all commits
Commits
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
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 )
);