insomnia/packages/insomnia-components/components/help-tooltip.js
Mike Ellan 5780a7c438
Help Tooltip Component Migration (#2200)
* 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>
2020-05-21 14:17:14 -04:00

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;