PluginProbe
WP Ultimate Post Grid / 3.8.0
WP Ultimate Post Grid v3.8.0
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / assets / js / shared / Tooltip.js

Tooltip.js in WP Ultimate Post Grid 3.8.0, at assets/js/shared/Tooltip.js

41 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from 'react';
2
3 import { Tooltip } from 'react-tippy';
4 import 'react-tippy/dist/tippy.css'
5
6 const OurTooltip = (props) => {
7 if ( ! props.content ) {
8 return props.children;
9 }
10
11 const style = props.hasOwnProperty( 'style' ) ? props.style : {};
12
13 return (
14 <Tooltip
15 html={
16 <div
17 dangerouslySetInnerHTML={ { __html: props.content } }
18 />
19 }
20 popperOptions={ {
21 modifiers: {
22 addZIndex: {
23 enabled: true,
24 order: 810,
25 fn: data => ({
26 ...data,
27 styles: {
28 ...data.styles,
29 zIndex: 100000,
30 },
31 })
32 }
33 }
34 } }
35 style={ style }
36 >
37 { props.children }
38 </Tooltip>
39 );
40 }
41 export default OurTooltip;