1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 07:19:41 +02:00

refactor(app): replace angularjs tooltip with react [EE-3606] (#7172)

* refactor(app): replace angularjs tooltip with react
This commit is contained in:
Chaim Lev-Ari 2022-07-04 02:21:25 +03:00 committed by GitHub
parent ebc0a8c772
commit d7306fb22e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 146 additions and 227 deletions

View file

@ -1,20 +1,29 @@
import ReactTooltip from 'react-tooltip';
import { HelpCircle } from 'react-feather';
import clsx from 'clsx';
import _ from 'lodash';
import styles from './Tooltip.module.css';
type Place = 'top' | 'right' | 'bottom' | 'left';
type Position = 'top' | 'right' | 'bottom' | 'left';
export interface Props {
position?: Place;
position?: Position;
message: string;
}
export function Tooltip({ message, position = 'bottom' }: Props) {
const id = `tooltip-${_.uniqueId()}`;
return (
<span data-tip={message} className={styles.icon}>
<span
data-tip={message}
data-for={id}
className={clsx(styles.icon, 'inline-flex text-base')}
>
<HelpCircle className="feather" aria-hidden="true" />
<ReactTooltip
id={id}
multiline
type="info"
place={position}