diff --git a/src/App.tsx b/src/App.tsx index e463efe9..010e7080 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -19,10 +19,8 @@ import "./App.css"; import AppFooter from "./components/App/AppFooter"; import AppHeader from "./components/App/AppHeader"; import { Container, Section, Bar } from "@column-resizer/react"; -import { RefreshCw } from "react-feather"; import { decompressSharedTd } from "./share"; import { editor } from "monaco-editor"; -import BaseButton from "./components/TDViewer/base/BaseButton"; import ErrorDialog from "./components/Dialogs/ErrorDialog"; const GlobalStateWrapper = () => { @@ -46,7 +44,7 @@ const App: React.FC = () => { const context = useContext(ediTDorContext); const editorRef = useRef(null); - const [doShowJSON, setDoShowJSON] = useState(false); + const [doShowJSON, setDoShowJSON] = useState(true); const [customBreakpointsState, setCustomBreakpointsState] = useState(0); const tdViewerRef = useRef(null); @@ -165,11 +163,16 @@ const App: React.FC = () => { return (
- +
-
+
{
- - -
- -
+ {doShowJSON && ( + <> + - - - +
+ {doShowJSON && } +
+ + )}
diff --git a/src/components/App/AppHeader.tsx b/src/components/App/AppHeader.tsx index 2974e581..4a99103c 100644 --- a/src/components/App/AppHeader.tsx +++ b/src/components/App/AppHeader.tsx @@ -26,6 +26,8 @@ import { Share, Link, Send, + Eye, + EyeOff, } from "react-feather"; import editdorLogo from "../../assets/editdor.png"; import ediTDorContext from "../../context/ediTDorContext"; @@ -49,7 +51,10 @@ const INVALID_TYPE_MESSAGE = const VALIDATION_FAILED_MESSAGE = "The Thing Model did not pass the JSON schema validation Please make sure the Thing Model is valid according to the JSON schema before contributing it to the catalog."; -const AppHeader: React.FC = () => { +const AppHeader: React.FC<{ + onToggleJSON: () => void; + isJSONVisible: boolean; +}> = ({ onToggleJSON, isJSONVisible }) => { const context = useContext(ediTDorContext); const td: ThingDescription = context.parsedTD; /** States*/ @@ -335,6 +340,12 @@ const AppHeader: React.FC = () => {
Settings
+