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:
parent
ebc0a8c772
commit
d7306fb22e
61 changed files with 146 additions and 227 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue