Skip to content

Commit cbedd76

Browse files
murphybrandonkiacolbert
authored andcommitted
Adding JSON viewing (#49)
* applying merge * have JSON viewing for action & state working
1 parent ecedb85 commit cbedd76

File tree

9 files changed

+7353
-31
lines changed

9 files changed

+7353
-31
lines changed

src/app/components/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,4 @@ class App extends Component {
257257
}
258258
}
259259

260-
export default App;
260+
export default App;
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import ReactJson from 'react-json-view';
23

34
//styled components
45
import { DetailsWrapper } from '../../../styles/Details.jsx';
@@ -8,11 +9,12 @@ export default function Actions(props) {
89
const { action } = props;
910
return (
1011
<DetailsWrapper>
11-
action:
12-
{(action && action.type) || 'select an event'}
13-
<br></br>
14-
payload:
15-
{(action && action.payload) || 'select an event'}
12+
{<ReactJson
13+
theme={'threezerotwofour'}
14+
style={{ backgroundColor: 'transparent' }}
15+
displayDataTypes={false}
16+
src={action}
17+
/> || 'select an event'}
1618
</DetailsWrapper>
1719
);
1820
}
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import React from 'react';
2+
import ReactJson from 'react-json-view';
23

34
export default function EffectCard(props) {
45
// renders the data to show
5-
const { stringData } = props;
6+
const { actionState } = props;
7+
68
return (
79
<div>
8-
{ stringData || 'select an event'}
10+
<ReactJson
11+
theme={'threezerotwofour'}
12+
style={{ backgroundColor: 'transparent', height: '-webkit-fill-available' }}
13+
displayDataTypes={false}
14+
src={actionState}
15+
/>
916
</div>
1017
);
1118
}

src/app/components/DetailCards/State/StateDisplay.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import { DetailsWrapper } from '../../../styles/Details.jsx';
77
export default function State(props) {
88
// stringifying data to pass down to StateCard to display
99
const { actionState } = props;
10-
const stringData = JSON.stringify(actionState, null, '\t');
11-
1210
return (
1311
<DetailsWrapper>
14-
{<StateCard stringData={stringData} />}
12+
{<StateCard actionState={actionState} />}
1513
</DetailsWrapper>
1614
);
1715
}

0 commit comments

Comments
 (0)