{ComponentRegistry, WorkspaceStore, Actions} = require "inbox-exports" {RetinaImg} = require 'ui-components' React = require "react" _ = require "underscore-plus" module.exports = ModeSwitch = React.createClass displayName: 'ModeSwitch' getInitialState: -> mode: WorkspaceStore.selectedLayoutMode() componentDidMount: -> @unsubscribe = WorkspaceStore.listen(@_onStateChanged, @) componentWillUnmount: -> @unsubscribe?() render: -> knobX = if @state.mode is 'list' then 25 else 41 # Currently ModeSwitch is an opaque control that is not intended # to be styled, hence the fixed margins and positions. If we # turn this into a standard component one day, change!