Changes after PR comments

This commit is contained in:
Hugo Häggmark 2019-01-09 13:20:50 +01:00
parent 67e8958aec
commit 236d7b1213
3 changed files with 14 additions and 20 deletions

View File

@ -15,10 +15,10 @@ interface State {
}
export class TestRuleButton extends PureComponent<Props, State> {
constructor(props) {
super(props);
this.state = { isLoading: false, testRuleResponse: {} };
}
readonly state: State = {
isLoading: false,
testRuleResponse: {},
};
componentDidMount() {
this.testRule();
@ -39,10 +39,6 @@ export class TestRuleButton extends PureComponent<Props, State> {
return <LoadingPlaceholder text="Evaluating rule" />;
}
return (
<>
<JSONFormatter json={testRuleResponse} />
</>
);
return <JSONFormatter json={testRuleResponse} />;
}
}

View File

@ -1,15 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Render should render component 1`] = `
<Fragment>
<JSONFormatter
config={
Object {
"animateOpen": true,
}
<JSONFormatter
config={
Object {
"animateOpen": true,
}
json={Object {}}
open={3}
/>
</Fragment>
}
json={Object {}}
open={3}
/>
`;

View File

@ -52,7 +52,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
onToggleToolBarView = (item: EditorToolbarView) => {
this.setState({
openView: item,
isOpen: this.state.openView !== item ? true : !this.state.isOpen,
isOpen: this.state.openView !== item || !this.state.isOpen,
});
};