Skip to content

Commit 3717a9a

Browse files
committed
AMP-30906: Resolve ndd dash bug
1 parent c931792 commit 3717a9a

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

amp/TEMPLATE/reampv2/packages/reampv2-app/src/utils/components/SimpleLegend.jsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { Tooltip } from 'react-tooltip';
2+
import ReactTooltip, { Tooltip } from 'react-tooltip';
33
import PropTypes from 'prop-types';
44
import './SimpleLegend.css';
55

@@ -8,7 +8,6 @@ export default class SimpleLegend extends Component {
88
const {
99
data, getColor
1010
} = this.props;
11-
console.log(data, getColor);
1211
let index = 0;
1312
return (
1413
<div className="simple-legend">
@@ -24,16 +23,27 @@ export default class SimpleLegend extends Component {
2423
border: `2px solid ${getColor(d)}`,
2524
backgroundColor: `${getColor(d)}`
2625
}}
27-
data-tip={d.name}
28-
data-for={index.toString()}
2926
data-tooltip-content={d.name}
27+
data-tooltip-id={index.toString()}
3028
data-tooltip-place="top"
31-
/>
32-
<span className="label">
29+
30+
>
31+
32+
</span>
33+
<span className="label"
34+
data-tooltip-content={d.name}
35+
data-tooltip-id={index.toString()}
36+
data-tooltip-place="top"
37+
style={{cursor: 'pointer'}}
38+
>
3339
{d.name.substring(0, 10)}
3440
<Tooltip
35-
backgroundColor={getColor(d)}
36-
id={index.toString()} />
41+
place="top"
42+
effect="float"
43+
style={{
44+
backgroundColor: `${getColor(d)}`
45+
}}
46+
id={index.toString()} />
3747
</span>
3848
</li>
3949
);

0 commit comments

Comments
 (0)