Skip to content

Commit 2be3aba

Browse files
(added) onMouseover event to dispatch hover action to the reducer from the componentMap
Co-authored-by: Alex Landeros <[email protected]>
1 parent 9353c5e commit 2be3aba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/app/components/ComponentMap.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { pointRadial } from 'd3-shape';
1111
import useForceUpdate from './useForceUpdate';
1212
import LinkControls from './LinkControls';
1313
import getLinkComponent from './getLinkComponent';
14+
import { onHover } from '../actions/actions'
15+
import { useStoreContext } from '../store'
1416

1517
const defaultMargin = { top: 30, left: 30, right: 30, bottom: 70 };
1618

@@ -28,6 +30,8 @@ export default function ComponentMap({
2830
margin = defaultMargin,
2931
snapshots: snapshots,
3032
}: LinkTypesProps) {
33+
34+
const [{ tabs, currentTab }, dispatch] = useStoreContext();
3135
// preparing the data to be used for render
3236
const lastNode = snapshots.length - 1;
3337
const data = snapshots[lastNode];
@@ -147,6 +151,7 @@ export default function ComponentMap({
147151
console.log(node);
148152
forceUpdate();
149153
}}
154+
onMouseEnter={()=>dispatch(onHover(node.data.rtid))}
150155
/>
151156
)}
152157
<text

0 commit comments

Comments
 (0)