mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
5780a7c438
* component migration to new SB instance Migrating help tooltip to new SB instance at /insomnia-components/ also styling component directly via styled components * Adding stories for positions and info vs. question * lint fix * Pulling left positioning out of delay story Co-authored-by: Gregory Schier <gschier1990@gmail.com>
36 lines
780 B
JavaScript
36 lines
780 B
JavaScript
// @flow
|
|
import * as React from 'react';
|
|
import autobind from 'autobind-decorator';
|
|
import Tooltip from './tooltip';
|
|
import SvgIcon from './svg-icon';
|
|
|
|
type Props = {
|
|
children: React.Node,
|
|
|
|
// Optional
|
|
position?: 'bottom' | 'top' | 'right' | 'left',
|
|
delay?: number,
|
|
className?: string,
|
|
style?: Object,
|
|
info?: boolean,
|
|
};
|
|
|
|
@autobind
|
|
class HelpTooltip extends React.PureComponent<Props> {
|
|
render() {
|
|
const { children, className, style, info, position, delay } = this.props;
|
|
return (
|
|
<Tooltip
|
|
position={position}
|
|
delay={delay}
|
|
className={className}
|
|
message={children}
|
|
style={style}>
|
|
{info ? <SvgIcon icon="info" /> : <SvgIcon icon="question" />}
|
|
</Tooltip>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default HelpTooltip;
|