2016-05-28 05:05:27 +08:00
import React from 'react' ;
2016-06-03 05:45:51 +08:00
import { AccountStore } from 'nylas-exports' ;
2016-05-28 05:05:27 +08:00
import { RetinaImg } from 'nylas-component-kit' ;
import OnboardingActions from './onboarding-actions' ;
export default class WelcomePage extends React . Component {
static displayName = "WelcomePage" ;
_onContinue = ( ) => {
2016-06-02 23:24:32 +08:00
// We don't have a NylasId yet and therefore can't track the "Welcome
// Page Finished" event.
//
// If a user already has a Nylas ID and gets to this page (which
// happens if they sign out of all of their accounts), then it would
// properly fire. This is a rare case though and we don't want
// analytics users thinking it's part of the full funnel.
//
// Actions.recordUserEvent('Welcome Page Finished');
2016-05-28 05:05:27 +08:00
OnboardingActions . moveToPage ( "tutorial" ) ;
}
2016-07-22 04:59:43 +08:00
_onSelfHosting = ( ) => {
OnboardingActions . moveToPage ( "self-hosting-setup" )
}
2016-05-28 05:05:27 +08:00
_renderContent ( isFirstAccount ) {
if ( isFirstAccount ) {
return (
< div >
< RetinaImg className = "logo" style = { { marginTop : 166 } } url = "nylas://onboarding/assets/nylas-logo@2x.png" mode = { RetinaImg . Mode . ContentPreserve } / >
< p className = "hero-text" style = { { fontSize : 46 , marginTop : 57 } } > Welcome to Nylas N1 < / p >
< RetinaImg className = "icons" url = "nylas://onboarding/assets/icons-bg@2x.png" mode = { RetinaImg . Mode . ContentPreserve } / >
< / div >
)
}
return (
< div >
< p className = "hero-text" style = { { fontSize : 46 , marginTop : 187 } } > Welcome back ! < / p >
2016-07-22 04:59:43 +08:00
< p className = "hero-text" style = { { fontSize : 20 , maxWidth : 550 , margin : 'auto' , lineHeight : 1.7 , marginTop : 30 } } > Since you 've been gone, we' ve < a href = "https://nylas.com/blog/nylas-pro/" > launched Nylas Pro < / a > , which now requires a paid subscription . Create a Nylas ID to start your trial and continue using N1 ! < / p >
2016-05-28 05:05:27 +08:00
< RetinaImg className = "icons" url = "nylas://onboarding/assets/icons-bg@2x.png" mode = { RetinaImg . Mode . ContentPreserve } / >
< / div >
)
}
render ( ) {
2016-07-22 04:59:43 +08:00
const isFirstAccount = ( AccountStore . accounts ( ) . length === 0 )
2016-05-28 05:05:27 +08:00
return (
< div className = { ` page welcome is-first-account- ${ isFirstAccount } ` } >
< div className = "steps-container" >
{ this . _renderContent ( isFirstAccount ) }
< / div >
< div className = "footer" >
< button key = "next" className = "btn btn-large btn-continue" onClick = { this . _onContinue } > Get Started < / button >
2016-07-22 04:59:43 +08:00
< div className = "btn-self-hosting" onClick = { this . _onSelfHosting } > Hosting your own sync engine ? < / div >
2016-05-28 05:05:27 +08:00
< / div >
< / div >
) ;
}
}