feat: Added tooltips to editor controls

This commit is contained in:
Tom Moor
2019-07-03 21:32:21 -07:00
parent 34f011d99f
commit d3abbcf9d5
4 changed files with 25 additions and 14 deletions

View File

@@ -7,6 +7,7 @@ import { withTheme } from 'styled-components';
import RichMarkdownEditor from 'rich-markdown-editor';
import { uploadFile } from 'utils/uploadFile';
import isInternalUrl from 'utils/isInternalUrl';
import Tooltip from 'components/Tooltip';
import Embed from './Embed';
import embeds from '../../embeds';
@@ -84,12 +85,15 @@ class Editor extends React.Component<Props> {
onClickLink={this.onClickLink}
onShowToast={this.onShowToast}
getLinkComponent={this.getLinkComponent}
tooltip={EditorTooltip}
{...this.props}
/>
);
}
}
const EditorTooltip = props => <Tooltip offset={8} {...props} />;
export default withTheme(
// $FlowIssue - https://github.com/facebook/flow/issues/6103
React.forwardRef((props, ref) => <Editor {...props} forwardedRef={ref} />)