mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-06 08:08:10 +08:00
aad21317e5
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
38 lines
918 B
CoffeeScript
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')
|