Mailspring/internal_packages/mode-switch/lib/mode-toggle.cjsx
Ben Gotow aad21317e5 feat(ui): Updates from March 17th mockups
Summary:
There are two known issues:
- toolbar is not draggable in some areas when in three-pane mode.
- archive button appears over very long subjects. Propose moving this button elsewhere.

WIP

WIP

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1311
2015-03-18 18:21:04 -07:00

38 lines
918 B
CoffeeScript

{ComponentRegistry,
WorkspaceStore,
Actions} = require "inbox-exports"
{RetinaImg} = require 'ui-components'
React = require "react"
_ = require "underscore-plus"
module.exports =
ModeToggle = React.createClass
displayName: 'ModeToggle'
getInitialState: ->
mode: WorkspaceStore.selectedLayoutMode()
componentDidMount: ->
@unsubscribe = WorkspaceStore.listen(@_onStateChanged, @)
componentWillUnmount: ->
@unsubscribe?()
render: ->
<div className="mode-switch"
style={order:51, marginTop:10, marginRight:14}
onClick={@_onToggleMode}>
<RetinaImg
name="toolbar-icon-toggle-pane.png"
onClick={@_onToggleMode} />
</div>
_onStateChanged: ->
@setState
mode: WorkspaceStore.selectedLayoutMode()
_onToggleMode: ->
if @state.mode is 'list'
Actions.selectLayoutMode('split')
else
Actions.selectLayoutMode('list')