Skip to content

Commit b321feb

Browse files
committed
test for action.jsx and action.jsx font color changes based on sliderIndex
1 parent 7cf1651 commit b321feb

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

src/app/components/Action.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import PropTypes from 'prop-types';
33

44
const Action = (props) => {
55
const {
6-
selected, handleChangeSnapshot, handleJumpSnapshot, index,
6+
selected, handleChangeSnapshot, handleJumpSnapshot, index, sliderIndex,
77
} = props;
8+
89
return (
910
<div
1011
className={selected ? 'action-component selected' : 'action-component'}
1112
onClick={() => handleChangeSnapshot(index)}
1213
role="presentation"
14+
style={index > sliderIndex ? { color: '#5f6369' } : {}}
1315
>
1416
<div className="action-component-text">{index}</div>
1517
<button

src/app/components/Tree.jsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@ import React from 'react';
22
import JSONTree from 'react-json-tree';
33
import PropTypes from 'prop-types';
44

5-
<<<<<<< HEAD
6-
const getItemString = data => <span>{data.name}</span>;
7-
=======
85
const getItemString = (type, data) => {
96
// check to make sure that we are on the tree node, not anything else
10-
if (Object.keys(data).length === 3 && typeof data.state === 'object' && typeof data.name === 'string' && Array.isArray(data.children)) {
11-
return (
12-
<span>
13-
{data.name}
14-
</span>
15-
);
7+
if (
8+
Object.keys(data).length === 3
9+
&& typeof data.state === 'object'
10+
&& typeof data.name === 'string'
11+
&& Array.isArray(data.children)
12+
) {
13+
return <span>{data.name}</span>;
1614
}
1715
};
18-
>>>>>>> dev
1916

2017
const Tree = (props) => {
2118
const { snapshot } = props;
@@ -27,9 +24,7 @@ const Tree = (props) => {
2724
theme={{ tree: () => ({ className: 'json-tree' }) }}
2825
shouldExpandNode={() => true}
2926
getItemString={getItemString}
30-
labelRenderer={(raw) => {
31-
return (typeof raw[0] !== 'number') ? <span>{raw[0]}</span> : null;
32-
}}
27+
labelRenderer={raw => (typeof raw[0] !== 'number' ? <span>{raw[0]}</span> : null)}
3328
/>
3429
)}
3530
</React.Fragment>

src/app/containers/ActionContainer.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const ActionContainer = ({
88
handleChangeSnapshot,
99
handleJumpSnapshot,
1010
emptySnapshot,
11+
sliderIndex,
1112
}) => {
1213
let actionsArr = [];
1314
if (snapshots.length > 0) {
@@ -19,6 +20,7 @@ const ActionContainer = ({
1920
index={index}
2021
snapshot={snapshot}
2122
selected={selected}
23+
sliderIndex={sliderIndex}
2224
handleChangeSnapshot={handleChangeSnapshot}
2325
handleJumpSnapshot={handleJumpSnapshot}
2426
/>
@@ -38,9 +40,7 @@ const ActionContainer = ({
3840
};
3941

4042
ActionContainer.propTypes = {
41-
snapshots: PropTypes.arrayOf(
42-
PropTypes.object,
43-
).isRequired,
43+
snapshots: PropTypes.arrayOf(PropTypes.object).isRequired,
4444
viewIndex: PropTypes.number.isRequired,
4545
handleChangeSnapshot: PropTypes.func.isRequired,
4646
handleJumpSnapshot: PropTypes.func.isRequired,

src/app/containers/MainContainer.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ class MainContainer extends Component {
201201
<ActionContainer
202202
snapshots={snapshots}
203203
viewIndex={viewIndex}
204+
sliderIndex={sliderIndex}
204205
handleChangeSnapshot={this.handleChangeSnapshot}
205206
handleJumpSnapshot={this.handleJumpSnapshot}
206207
emptySnapshot={this.emptySnapshot}

src/app/styles/layout/_stateContainer.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// prevent navbar from scrolling with state/tree display
1818
position: sticky;
1919
top: 0px;
20+
left: 0px;
2021
z-index: 1;
2122
}
2223

0 commit comments

Comments
 (0)