Skip to content

Commit 308a7a3

Browse files
committed
have JSON viewing for action & state working
1 parent 3ddd160 commit 308a7a3

File tree

8 files changed

+7352
-30
lines changed

8 files changed

+7352
-30
lines changed
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
}

src/app/package-lock.json

Lines changed: 7329 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"html-webpack-plugin": "^3.2.0",
3030
"react": "^16.8.3",
3131
"react-dom": "^16.8.3",
32+
"react-json-view": "^1.19.1",
3233
"react-router-dom": "^4.3.1",
3334
"style-loader": "^0.23.1",
3435
"styled-components": "^4.1.3",

src/app/styles/Details.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ import styled from 'styled-components';
33
export const DetailsWrapper = styled.div`
44
padding-left: 10px;
55
padding-top: 10px;
6-
`;
6+
/* background-color: red; */
7+
overflow: auto;
8+
height: calc(100% - 45px)
9+
`;

src/app/styles/Events.jsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,3 @@ export const EventTimeDiv = styled.div`
3333
color: ${props => props.selectedEvent === 'false' ? 'white' : "white"};
3434
border-radius: 5px;
3535
`;
36-
37-
// wrapper for previous and next buttons
38-
export const PreviousNextWrapper = styled.div`
39-
padding-top: 4%;
40-
padding-bottom: 4%;
41-
display: flex;
42-
justify-content: space-evenly;
43-
`;
44-
45-
// button for previous and next (copied from EventTimeDiv for trial)
46-
export const PrevNextButton = styled.div`
47-
cursor: pointer;
48-
width: 25%;
49-
text-align: center;
50-
background-color: ${props => props.selectedEvent === 'false' ? '#484C54' : "#3C444F"};
51-
color: ${props => props.selectedEvent === 'false' ? 'white' : "white"};
52-
border-radius: 5px;
53-
`;

src/app/styles/SplitPane.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export const LeftPane = styled.div`
2828
`;
2929

3030
// wrapper for details (right hand side)
31+
// UPDATED
3132
export const RightPane = styled.div`
3233
color: white;
3334
background-color: #2A2E3A;
34-
height: 100%;
3535
width: 57%;
3636
`;

0 commit comments

Comments
 (0)