-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1559 from Automattic/add/design-type-flow
Signup: Add first draft of "Triforce" flow
- Loading branch information
Showing
11 changed files
with
199 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import StepWrapper from 'signup/step-wrapper'; | ||
import SignupActions from 'lib/signup/actions'; | ||
import analytics from 'analytics'; | ||
import getThemes from './themes-map'; | ||
import Card from 'components/card'; | ||
|
||
export default React.createClass( { | ||
displayName: 'DesignType', | ||
|
||
getChoices() { | ||
return [ | ||
{ type: 'blog', label: this.translate( 'A list of my latest posts' ), image: '/calypso/images/signup/design-type/design-type-latest.svg' }, | ||
{ type: 'page', label: this.translate( 'A welcome page for my site' ), image: '/calypso/images/signup/design-type/design-type-welcome.svg' }, | ||
{ type: 'grid', label: this.translate( 'A grid of my latest posts' ), image: '/calypso/images/signup/design-type/design-type-grid.svg' }, | ||
]; | ||
}, | ||
|
||
renderChoice( choice ) { | ||
return ( | ||
<Card className="design-type__choice" key={ choice.type }> | ||
<a className="design-type__choice__link" href="#" onClick={ ( event ) => this.handleChoiceClick( event, choice.type ) }> | ||
<img src={ choice.image } /> | ||
<h2>{ choice.label }</h2> | ||
</a> | ||
</Card> | ||
); | ||
}, | ||
|
||
renderChoices() { | ||
return ( | ||
<div className="design-type__list"> | ||
{ this.getChoices().map( this.renderChoice ) } | ||
</div> | ||
); | ||
}, | ||
|
||
render() { | ||
return ( | ||
<div className="design-type__section-wrapper"> | ||
<StepWrapper | ||
flowName={ this.props.flowName } | ||
stepName={ this.props.stepName } | ||
positionInFlow={ this.props.positionInFlow } | ||
headerText={ this.translate( 'What would you like your homepage to look like?' ) } | ||
subHeaderText={ this.translate( 'This will help us figure out what kinds of designs to show you.' ) } | ||
signupProgressStore={ this.props.signupProgressStore } | ||
stepContent={ this.renderChoices() } /> | ||
</div> | ||
); | ||
}, | ||
|
||
handleChoiceClick( event, type ) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
this.handleNextStep( type ); | ||
}, | ||
|
||
handleNextStep( designType ) { | ||
const themes = getThemes( designType ); | ||
|
||
analytics.tracks.recordEvent( 'calypso_triforce_select_design', { category: designType } ); | ||
|
||
SignupActions.submitSignupStep( { stepName: this.props.stepName }, [], { themes } ); | ||
this.props.goToNextStep(); | ||
} | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.design-type__list { | ||
display: flex; | ||
flex-flow: row wrap; | ||
} | ||
|
||
.design-type__choice { | ||
padding: 0; | ||
margin: 0 10px 20px 10px; | ||
width: 230px; | ||
flex-grow: 1; | ||
transition: all 100ms ease-in-out; | ||
|
||
a, img { | ||
display: block; | ||
} | ||
|
||
h2 { | ||
color: #000; | ||
padding-left: 15px; | ||
border-top: 1px solid transparentize( lighten( $gray, 20% ), .5 ); | ||
font-weight: bold; | ||
line-height: 54px; | ||
} | ||
|
||
&:hover { | ||
box-shadow: 0 0 0 1px $gray, 0 2px 4px lighten( $gray, 20 ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import shuffle from 'lodash/collection/shuffle'; | ||
|
||
const map = { | ||
blog: [ | ||
{ name: 'Button', slug: 'button' }, | ||
{ name: 'Franklin', slug: 'franklin' }, | ||
{ name: 'Sapor', slug: 'sapor' }, | ||
{ name: 'Colinear', slug: 'colinear' }, | ||
{ name: 'Minnow', slug: 'minnow' }, | ||
{ name: 'Eighties', slug: 'eighties' }, | ||
{ name: 'Libre', slug: 'libre' }, | ||
{ name: 'Penscratch', slug: 'penscratch' }, | ||
{ name: 'Libretto', slug: 'libretto' }, | ||
], | ||
page: [ | ||
{ name: 'Gateway', slug: 'gateway' }, | ||
{ name: 'Edin', slug: 'edin' }, | ||
{ name: 'Sequential', slug: 'sequential' }, | ||
{ name: 'Goran', slug: 'goran' }, | ||
{ name: 'Sela', slug: 'sela' }, | ||
{ name: 'Motif', slug: 'motif' }, | ||
{ name: 'Big Brother', slug: 'big-brother' }, | ||
{ name: 'Argent', slug: 'argent' }, | ||
{ name: 'Harmonic', slug: 'harmonic' }, | ||
], | ||
grid: [ | ||
{ name: 'Dyad', slug: 'dyad' }, | ||
{ name: 'Blask', slug: 'blask' }, | ||
{ name: 'Cubic', slug: 'cubic' }, | ||
{ name: 'Illustratr', slug: 'illustratr' }, | ||
{ name: 'Snaps', slug: 'snaps' }, | ||
{ name: 'Sketch', slug: 'sketch' }, | ||
{ name: 'Gazette', slug: 'gazette' }, | ||
{ name: 'Apostrophe', slug: 'apostrophe' }, | ||
{ name: 'Pictorico', slug: 'pictorico' }, | ||
] | ||
}; | ||
|
||
export default function getThemes( key ) { | ||
return shuffle( map[ key ] || [] ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.