Mailspring/internal_packages/settings/lib/settings-view.cjsx
Ben Gotow 2b324c4533 feature(package-management): Package management interface, APM integration
Summary:
Update a few more packages to deactivate properly

Miscelaneous fixes

Initial commit of new settings package

WIP

WIP - can load and unload and install / uninstall

Click to create new boilerplate package, package updating

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1582
2015-06-02 19:04:21 -07:00

35 lines
825 B
CoffeeScript

React = require 'react'
_ = require "underscore"
{Flexbox} = require 'nylas-component-kit'
classNames = require 'classnames'
SettingsStore = require './settings-store'
Tabs = require './tabs'
class SettingsView extends React.Component
@displayName: 'SettingsView'
constructor: (@props) ->
@state = @_getStateFromStores()
render: =>
SettingsTabComponent = Tabs[@state.tabIndex].component
<div className="settings-view">
<SettingsTabComponent />
</div>
componentDidMount: =>
@_unsubscribers = []
@_unsubscribers.push SettingsStore.listen(@_onChange)
componentWillUnmount: =>
unsubscribe() for unsubscribe in @_unsubscribers
_getStateFromStores: =>
tabIndex: SettingsStore.tabIndex()
_onChange: =>
@setState(@_getStateFromStores())
module.exports = SettingsView