From 758155f7761c00fd7be65a00872d9f2195140aaf Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Mon, 20 Feb 2023 01:32:00 +0100 Subject: [PATCH] Implemented the ViewContext into the App.jsx --- client/src/App.jsx | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/client/src/App.jsx b/client/src/App.jsx index ce3b9305..ad78f64b 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -5,11 +5,21 @@ import {SpeedtestProvider} from "./common/contexts/Speedtests"; import {ConfigProvider} from "./common/contexts/Config"; import {StatusProvider} from "./common/contexts/Status"; import {InputDialogProvider} from "@/common/contexts/InputDialog/InputDialog"; -import {useState} from "react"; +import {useContext, useState} from "react"; import i18n from './i18n'; import Loading from "@/pages/Loading"; import "@/common/styles/spinner.sass"; import Error from "@/pages/Error"; +import {ViewContext, ViewProvider} from "@/common/contexts/View"; + +const MainContent = () => { + const [view] = useContext(ViewContext); + return ( +
+ {view === 0 && } +
+ ); +} const App = () => { const [translationsLoaded, setTranslationsLoaded] = useState(false); @@ -24,14 +34,14 @@ const App = () => { {translationError && } {translationsLoaded && !translationError && - - - -
- -
-
-
+ + + + + + + +
}