improvement(editor): add title to toggle buttons (#2548)
This commit is contained in:
parent
9cb7cd7214
commit
6e6e4b86ca
@ -257,12 +257,14 @@ class EditorInterface extends Component {
|
||||
active={previewVisible}
|
||||
onClick={this.handleTogglePreview}
|
||||
icon="eye"
|
||||
title="Toggle preview"
|
||||
/>
|
||||
<EditorToggle
|
||||
enabled={collectionPreviewEnabled && previewVisible}
|
||||
active={scrollSyncEnabled}
|
||||
onClick={this.handleToggleScrollSync}
|
||||
icon="scroll"
|
||||
title="Sync scrolling"
|
||||
/>
|
||||
</ViewControls>
|
||||
{collectionPreviewEnabled && this.state.previewVisible ? (
|
||||
|
@ -18,9 +18,9 @@ const EditorToggleButton = styled.button`
|
||||
margin-bottom: 12px;
|
||||
`;
|
||||
|
||||
const EditorToggle = ({ enabled, active, onClick, icon }) =>
|
||||
const EditorToggle = ({ enabled, active, onClick, icon, title }) =>
|
||||
!enabled ? null : (
|
||||
<EditorToggleButton onClick={onClick} isActive={active}>
|
||||
<EditorToggleButton onClick={onClick} isActive={active} title={title}>
|
||||
<Icon type={icon} size="large" />
|
||||
</EditorToggleButton>
|
||||
);
|
||||
@ -30,6 +30,7 @@ EditorToggle.propTypes = {
|
||||
active: PropTypes.bool,
|
||||
onClick: PropTypes.func.isRequired,
|
||||
icon: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export default EditorToggle;
|
||||
|
Loading…
x
Reference in New Issue
Block a user