2015-09-23 11:11:51 +08:00
|
|
|
React = require 'react'
|
2015-09-30 14:58:30 +08:00
|
|
|
path = require 'path'
|
2015-09-23 11:11:51 +08:00
|
|
|
{RetinaImg, ConfigPropContainer} = require 'nylas-component-kit'
|
|
|
|
{EdgehillAPI} = require 'nylas-exports'
|
|
|
|
OnboardingActions = require './onboarding-actions'
|
|
|
|
|
2015-09-30 14:58:30 +08:00
|
|
|
class InstallButton extends React.Component
|
2015-09-23 11:11:51 +08:00
|
|
|
constructor: (@props) ->
|
2015-09-30 14:58:30 +08:00
|
|
|
@state =
|
2016-01-08 06:56:34 +08:00
|
|
|
installed: !NylasEnv.packages.isPackageDisabled(@props.package.name)
|
2015-09-23 11:11:51 +08:00
|
|
|
|
|
|
|
render: =>
|
2015-09-30 14:58:30 +08:00
|
|
|
classname = "btn btn-install"
|
|
|
|
classname += " installed" if @state.installed
|
|
|
|
|
|
|
|
<div className={classname} onClick={@_onInstall}></div>
|
|
|
|
|
|
|
|
_onInstall: =>
|
2016-01-08 06:56:34 +08:00
|
|
|
NylasEnv.packages.enablePackage(@props.package.name)
|
|
|
|
@setState(installed: true)
|
2015-09-30 14:58:30 +08:00
|
|
|
|
2015-09-25 05:51:15 +08:00
|
|
|
class InitialPackagesPage extends React.Component
|
2015-09-23 11:11:51 +08:00
|
|
|
@displayName: "InitialPackagesPage"
|
|
|
|
|
2015-10-01 02:43:00 +08:00
|
|
|
constructor: (@props) ->
|
2016-01-08 06:56:34 +08:00
|
|
|
@state =
|
|
|
|
packages: NylasEnv.packages.getAvailablePackageMetadata().filter ({isStarterPackage}) => isStarterPackage
|
2015-10-01 02:43:00 +08:00
|
|
|
|
2015-09-23 11:11:51 +08:00
|
|
|
render: =>
|
2015-09-28 17:12:35 +08:00
|
|
|
<div className="page opaque" style={width:900, height:650}>
|
2015-09-23 11:11:51 +08:00
|
|
|
<div className="back" onClick={@_onPrevPage}>
|
|
|
|
<RetinaImg name="onboarding-back.png" mode={RetinaImg.Mode.ContentPreserve}/>
|
|
|
|
</div>
|
2015-09-30 14:58:30 +08:00
|
|
|
|
2015-10-05 17:01:27 +08:00
|
|
|
<h1 style={paddingTop: 60, marginBottom: 20}>Explore plugins</h1>
|
2015-09-30 14:58:30 +08:00
|
|
|
<p style={paddingBottom: 20}>
|
2015-10-30 10:35:22 +08:00
|
|
|
Plugins lie at the heart of N1 and give it its powerful features.<br/>
|
2016-01-08 10:44:40 +08:00
|
|
|
Want to enable a few example plugins now?
|
2015-09-23 11:11:51 +08:00
|
|
|
</p>
|
|
|
|
|
2015-09-30 14:58:30 +08:00
|
|
|
<div>
|
2015-10-01 02:43:00 +08:00
|
|
|
{@state.packages.map (item) =>
|
|
|
|
<div className="initial-package" key={item.name}>
|
2016-01-08 06:56:34 +08:00
|
|
|
<img src="nylas://#{item.name}/#{item.icon}" style={width:50} />
|
2015-09-30 14:58:30 +08:00
|
|
|
<div className="install-container">
|
2016-01-08 06:56:34 +08:00
|
|
|
<InstallButton package={item} />
|
2015-09-30 14:58:30 +08:00
|
|
|
</div>
|
2015-10-01 02:43:00 +08:00
|
|
|
<div className="name">{item.title}</div>
|
2015-09-30 14:58:30 +08:00
|
|
|
<div className="description">{item.description}</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
2016-01-08 10:44:40 +08:00
|
|
|
|
2015-10-01 02:43:00 +08:00
|
|
|
<button className="btn btn-large btn-get-started btn-emphasis"
|
|
|
|
style={marginTop: 15}
|
|
|
|
onClick={@_onGetStarted}>
|
|
|
|
Start Using N1
|
|
|
|
</button>
|
2015-09-23 11:11:51 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
_onPrevPage: =>
|
|
|
|
OnboardingActions.moveToPage('initial-preferences')
|
|
|
|
|
|
|
|
_onGetStarted: =>
|
2016-01-08 06:56:34 +08:00
|
|
|
require('electron').ipcRenderer.send('account-setup-successful')
|
2015-09-23 11:11:51 +08:00
|
|
|
|
|
|
|
module.exports = InitialPackagesPage
|