mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Feature: Show tooltip for widgets (#318)
* Show tooltip containing widget description when hovered over a widget * Refactor import
This commit is contained in:
parent
301c385816
commit
511022b3e9
1 changed files with 7 additions and 0 deletions
|
|
@ -15,6 +15,8 @@ import { Multiselect } from './Components/Multiselect';
|
|||
import { Modal } from './Components/Modal';
|
||||
import { Chart } from './Components/Chart';
|
||||
import { Map } from './Components/Map';
|
||||
import { renderTooltip } from '../_helpers/appUtils';
|
||||
import OverlayTrigger from 'react-bootstrap/OverlayTrigger';
|
||||
|
||||
const AllComponents = {
|
||||
Button,
|
||||
|
|
@ -68,6 +70,10 @@ export const Box = function Box({
|
|||
const ComponentToRender = AllComponents[component.component];
|
||||
|
||||
return (
|
||||
<OverlayTrigger
|
||||
placement="top"
|
||||
overlay={(props) => renderTooltip({props, text: `${component.description}`})}
|
||||
>
|
||||
<div style={{ ...styles, backgroundColor }} role={preview ? 'BoxPreview' : 'Box'}>
|
||||
{inCanvas ? (
|
||||
<ComponentToRender
|
||||
|
|
@ -106,5 +112,6 @@ export const Box = function Box({
|
|||
</div>
|
||||
)}
|
||||
</div>
|
||||
</OverlayTrigger>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue