Skip to content

Commit afa2511

Browse files
committed
changing line 28 in Diff.jsx, and changing all code to es lint format
1 parent 32737c6 commit afa2511

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/app/components/Diff.jsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import React from "react";
2-
import PropTypes from "prop-types";
3-
import { diff, formatters } from "jsondiffpatch";
4-
import ReactHtmlParser from "react-html-parser";
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { diff, formatters } from 'jsondiffpatch';
4+
import ReactHtmlParser from 'react-html-parser';
55

6-
import { useStoreContext } from "../store";
6+
import { useStoreContext } from '../store';
77

88
function Diff({ snapshot, show }) {
99
const [mainState] = useStoreContext();
10-
const { currentTab, tabs } = mainState; //Nate:: k/v pairs of mainstate store object being created
10+
const { currentTab, tabs } = mainState; // Nate:: k/v pairs of mainstate store object being created
1111
const { snapshots, viewIndex, sliderIndex } = tabs[currentTab];
1212
let previous;
1313

@@ -17,17 +17,16 @@ function Diff({ snapshot, show }) {
1717
} else {
1818
previous = snapshots[sliderIndex - 1];
1919
}
20-
// Nate:: diff function from jsondiffpatch is supposed to return a comparaison of two objects, one has an updated change
20+
// Nate:: diff function returns a comparaison of two objects, one has an updated change
2121
const delta = diff(previous, snapshot);
2222
// returns html in string
2323
const html = formatters.html.format(delta, previous);
2424
if (show) formatters.html.showUnchanged();
2525
else formatters.html.hideUnchanged();
2626

27-
if (previous === undefined || delta === undefined)
28-
return (
29-
<div> No state change detected. Trigger an event to change state </div>
30-
);
27+
if (previous === undefined || delta === undefined) {
28+
return <div> No state change detected. Trigger an event to change state </div>;
29+
}
3130
return <div>{ReactHtmlParser(html)}</div>;
3231
}
3332

0 commit comments

Comments
 (0)