Skip to content

Commit 79110c9

Browse files
committed
(fixed) node was not dispatching actions properly
1 parent a08eb19 commit 79110c9

File tree

2 files changed

+23
-30
lines changed

2 files changed

+23
-30
lines changed

src/app/components/History.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import React, { Component, useEffect, useState } from 'react';
22
import * as d3 from 'd3';
33
import LegendKey from './legend';
44
import { changeView, changeSlider } from '../actions/actions';
5-
import { useStoreContext } from '../store';
6-
import { string } from 'prop-types';
75

86
/**
97
* @var colors: Colors array for the diffrerent node branches, each color is for a different branch

src/app/components/StateRoute.tsx

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,8 @@ interface StateRouteProps {
4545

4646
const StateRoute = (props: StateRouteProps) => {
4747
const { snapshot, hierarchy, snapshots, viewIndex } = props;
48-
<<<<<<< HEAD
4948
const [{ tabs, currentTab }, dispatch] = useStoreContext();
5049
const { hierarchy, sliderIndex, viewIndex } = tabs[currentTab];
51-
=======
52-
53-
console.log(hierarchy);
54-
>>>>>>> e938454e37a781e16248bb535d0850ea3a0020fd
5550

5651
const isRecoil = snapshot.atomsComponents ? true : false;
5752
const [noRenderData, setNoRenderData] = useState(false);
@@ -67,7 +62,7 @@ const StateRoute = (props: StateRouteProps) => {
6762
</ParentSize>
6863
);
6964
}
70-
return <div className='noState'>{NO_STATE_MSG}</div>;
65+
return <div className="noState">{NO_STATE_MSG}</div>;
7166
};
7267

7368
// the hierarchy gets set on the first click in the page
@@ -84,7 +79,7 @@ const StateRoute = (props: StateRouteProps) => {
8479
/>
8580
);
8681
}
87-
return <div className='noState'>{NO_STATE_MSG}</div>;
82+
return <div className="noState">{NO_STATE_MSG}</div>;
8883
};
8984

9085
const renderAtomsRelationship = () => (
@@ -102,7 +97,7 @@ const StateRoute = (props: StateRouteProps) => {
10297
if (hierarchy) {
10398
return <Tree snapshot={snapshot} />;
10499
}
105-
return <div className='noState'>{NO_STATE_MSG}</div>;
100+
return <div className="noState">{NO_STATE_MSG}</div>;
106101
};
107102

108103
const renderPerfView = () => {
@@ -128,55 +123,55 @@ const StateRoute = (props: StateRouteProps) => {
128123
// />
129124
);
130125
}
131-
return <div className='noState'>{NO_STATE_MSG}</div>;
126+
return <div className="noState">{NO_STATE_MSG}</div>;
132127
};
133128

134129
return (
135130
<Router>
136-
<div className='navbar'>
131+
<div className="navbar">
137132
<NavLink
138-
className='router-link'
139-
activeClassName='is-active'
133+
className="router-link"
134+
activeClassName="is-active"
140135
exact
141-
to='/'
136+
to="/"
142137
>
143138
Tree
144139
</NavLink>
145140
<NavLink
146-
className='router-link'
147-
activeClassName='is-active'
148-
to='/history'
141+
className="router-link"
142+
activeClassName="is-active"
143+
to="/history"
149144
>
150145
History
151146
</NavLink>
152-
<NavLink className='router-link' activeClassName='is-active' to='/map'>
147+
<NavLink className="router-link" activeClassName="is-active" to="/map">
153148
Map
154149
</NavLink>
155150

156151
{isRecoil && (
157152
<NavLink
158-
className='router-link'
159-
activeClassName='is-active'
160-
to='/relationship'
153+
className="router-link"
154+
activeClassName="is-active"
155+
to="/relationship"
161156
>
162157
AtomsRecoil
163158
</NavLink>
164159
)}
165160

166161
<NavLink
167-
className='router-link'
168-
activeClassName='is-active'
169-
to='/performance'
162+
className="router-link"
163+
activeClassName="is-active"
164+
to="/performance"
170165
>
171166
Performance
172167
</NavLink>
173168
</div>
174169
<Switch>
175-
<Route path='/map' render={renderComponentMap} />
176-
<Route path='/history' render={renderHistory} />
177-
<Route path='/relationship' render={renderAtomsRelationship} />
178-
<Route path='/performance' render={renderPerfView} />
179-
<Route path='/' render={renderTree} />
170+
<Route path="/map" render={renderComponentMap} />
171+
<Route path="/history" render={renderHistory} />
172+
<Route path="/relationship" render={renderAtomsRelationship} />
173+
<Route path="/performance" render={renderPerfView} />
174+
<Route path="/" render={renderTree} />
180175
</Switch>
181176
</Router>
182177
);

0 commit comments

Comments
 (0)