|
1 |
| -import PropTypes from 'prop-types' |
2 |
| -import React from 'react' |
3 |
| -import CSSModules from 'browser/lib/CSSModules' |
4 |
| -import styles from './ToggleModeButton.styl' |
5 |
| -import i18n from 'browser/lib/i18n' |
6 |
| - |
7 |
| -const ToggleModeButton = ({ |
8 |
| - onClick, editorType |
9 |
| -}) => ( |
10 |
| - <div styleName='control-toggleModeButton'> |
11 |
| - <div styleName={editorType === 'SPLIT' ? 'active' : 'non-active'} onClick={() => onClick('SPLIT')}> |
12 |
| - <img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '../resources/icon/icon-mode-markdown-off-active.svg' : ''} /> |
13 |
| - </div> |
14 |
| - <div styleName={editorType === 'EDITOR_PREVIEW' ? 'active' : 'non-active'} onClick={() => onClick('EDITOR_PREVIEW')}> |
15 |
| - <img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '' : '../resources/icon/icon-mode-split-on-active.svg'} /> |
16 |
| - </div> |
17 |
| - <span styleName='tooltip'>{i18n.__('Toggle Mode')}</span> |
18 |
| - </div> |
19 |
| -) |
20 |
| - |
21 |
| -ToggleModeButton.propTypes = { |
22 |
| - onClick: PropTypes.func.isRequired, |
23 |
| - editorType: PropTypes.string.Required |
24 |
| -} |
25 |
| - |
26 |
| -export default CSSModules(ToggleModeButton, styles) |
| 1 | +import PropTypes from 'prop-types' |
| 2 | +import React from 'react' |
| 3 | +import CSSModules from 'browser/lib/CSSModules' |
| 4 | +import styles from './ToggleModeButton.styl' |
| 5 | +import i18n from 'browser/lib/i18n' |
| 6 | + |
| 7 | +const ToggleModeButton = ({ |
| 8 | + onClick, editorType |
| 9 | +}) => ( |
| 10 | + <div styleName='control-toggleModeButton'> |
| 11 | + <div styleName={editorType === 'SPLIT' ? 'active' : 'non-active'} onClick={() => onClick('SPLIT')}> |
| 12 | + <img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '../resources/icon/icon-mode-markdown-off-active.svg' : ''} /> |
| 13 | + </div> |
| 14 | + <div styleName={editorType === 'EDITOR_PREVIEW' ? 'active' : 'non-active'} onClick={() => onClick('EDITOR_PREVIEW')}> |
| 15 | + <img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '' : '../resources/icon/icon-mode-split-on-active.svg'} /> |
| 16 | + </div> |
| 17 | + <span styleName='tooltip'>{i18n.__('Toggle Mode')}</span> |
| 18 | + </div> |
| 19 | +) |
| 20 | + |
| 21 | +ToggleModeButton.propTypes = { |
| 22 | + onClick: PropTypes.func.isRequired, |
| 23 | + editorType: PropTypes.string.Required |
| 24 | +} |
| 25 | + |
| 26 | +export default CSSModules(ToggleModeButton, styles) |
0 commit comments