Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Yang committed May 10, 2022
1 parent 3bdd903 commit cde64e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 3 additions & 5 deletions website/playground/src/TreeStyleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Dispatch, SetStateAction } from "react";

interface Props {
treeStyle: TreeStyle;
setTreeStyle: Dispatch<SetStateAction<TreeStyle>>;
setTreeStyle: (treeStyle: TreeStyle) => void;
}

export default function TreeStyleSelect({ treeStyle, setTreeStyle }: Props) {
Expand All @@ -28,7 +28,7 @@ export default function TreeStyleSelect({ treeStyle, setTreeStyle }: Props) {
>
<span
className={classNames(
"sr-only lg:not-sr-only text-gray-900",
"text-gray-900",
treeStyle === TreeStyle.Json
? "text-gray-900"
: "text-gray-600 group-hover:text-gray-900"
Expand All @@ -47,9 +47,7 @@ export default function TreeStyleSelect({ treeStyle, setTreeStyle }: Props) {
"bg-white shadow-sm ring-1 ring-black ring-opacity-5"
)}
>
<span className="sr-only lg:not-sr-only text-gray-600 text-gray-900">
Text
</span>
<span className="text-gray-900">Text</span>
</button>
</div>
);
Expand Down
5 changes: 2 additions & 3 deletions website/playground/src/TreeView.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
//@ts-ignore
import ReactJson from "react-json-view";
import TreeStyleSelect from "./TreeStyleSelect";
import { Dispatch, SetStateAction } from "react";
import { TreeStyle } from "./types";

interface Props {
tree: string;
treeStyle: TreeStyle;
setTreeStyle: Dispatch<SetStateAction<TreeStyle>>;
setTreeStyle: (treeStyle: TreeStyle) => void;
}

export default function TreeView({ tree, treeStyle, setTreeStyle }: Props) {
return (
<div className="overflow-scroll">
<TreeStyleSelect treeStyle={treeStyle} setTreeStyle={setTreeStyle} />
{treeStyle === TreeStyle.Json ? (
<ReactJson style={{ zIndex: "10 " }} src={JSON.parse(tree)} />
<ReactJson src={JSON.parse(tree)} />
) : (
<pre>{tree}</pre>
)}
Expand Down

0 comments on commit cde64e2

Please sign in to comment.