-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2499 from daiyam/store-editor-status
store editor view into config
- Loading branch information
Showing
3 changed files
with
36 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import CSSModules from 'browser/lib/CSSModules' | ||
import styles from './ToggleModeButton.styl' | ||
import i18n from 'browser/lib/i18n' | ||
|
||
const ToggleModeButton = ({ | ||
onClick, editorType | ||
}) => ( | ||
<div styleName='control-toggleModeButton'> | ||
<div styleName={editorType === 'SPLIT' ? 'active' : 'non-active'} onClick={() => onClick('SPLIT')}> | ||
<img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '../resources/icon/icon-mode-markdown-off-active.svg' : ''} /> | ||
</div> | ||
<div styleName={editorType === 'EDITOR_PREVIEW' ? 'active' : 'non-active'} onClick={() => onClick('EDITOR_PREVIEW')}> | ||
<img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '' : '../resources/icon/icon-mode-split-on-active.svg'} /> | ||
</div> | ||
<span styleName='tooltip'>{i18n.__('Toggle Mode')}</span> | ||
</div> | ||
) | ||
|
||
ToggleModeButton.propTypes = { | ||
onClick: PropTypes.func.isRequired, | ||
editorType: PropTypes.string.Required | ||
} | ||
|
||
export default CSSModules(ToggleModeButton, styles) | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import CSSModules from 'browser/lib/CSSModules' | ||
import styles from './ToggleModeButton.styl' | ||
import i18n from 'browser/lib/i18n' | ||
|
||
const ToggleModeButton = ({ | ||
onClick, editorType | ||
}) => ( | ||
<div styleName='control-toggleModeButton'> | ||
<div styleName={editorType === 'SPLIT' ? 'active' : 'non-active'} onClick={() => onClick('SPLIT')}> | ||
<img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '../resources/icon/icon-mode-markdown-off-active.svg' : ''} /> | ||
</div> | ||
<div styleName={editorType === 'EDITOR_PREVIEW' ? 'active' : 'non-active'} onClick={() => onClick('EDITOR_PREVIEW')}> | ||
<img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '' : '../resources/icon/icon-mode-split-on-active.svg'} /> | ||
</div> | ||
<span styleName='tooltip'>{i18n.__('Toggle Mode')}</span> | ||
</div> | ||
) | ||
|
||
ToggleModeButton.propTypes = { | ||
onClick: PropTypes.func.isRequired, | ||
editorType: PropTypes.string.Required | ||
} | ||
|
||
export default CSSModules(ToggleModeButton, styles) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters