diff options
| author | 2022-01-25 22:03:00 +0100 | |
|---|---|---|
| committer | 2022-01-25 22:06:58 +0100 | |
| commit | f69a7786da3ba21373574ee6c96371769a72ac42 (patch) | |
| tree | a9e9cc0cb6122223b4f0e3d8a533733b55cb44df /src/components/App/App.tsx | |
| parent | f9cd68181137c72e92c6951efd9b8d29c4b73bc1 (diff) | |
| download | client-f69a7786da3ba21373574ee6c96371769a72ac42.tar.gz client-f69a7786da3ba21373574ee6c96371769a72ac42.tar.bz2 client-f69a7786da3ba21373574ee6c96371769a72ac42.zip | |
Fixed issue with json viewer
Diffstat (limited to 'src/components/App/App.tsx')
| -rw-r--r-- | src/components/App/App.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx index bbab612..3f50f22 100644 --- a/src/components/App/App.tsx +++ b/src/components/App/App.tsx | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | import * as React from "react"; | 1 | import * as React from "react"; |
| 2 | import {ReactElement, useEffect, useMemo, useState} from "react"; | 2 | import {ReactElement, useContext, useEffect, useMemo, useState} from "react"; |
| 3 | import useRequests, { | 3 | import useRequests, { |
| 4 | ReadyState, | 4 | ReadyState, |
| 5 | RequestResponse | 5 | RequestResponse |
| @@ -16,6 +16,7 @@ import {Sliders} from "../Icons/Sliders"; | |||
| 16 | import {Sun} from "../Icons/Sun"; | 16 | import {Sun} from "../Icons/Sun"; |
| 17 | import {Moon} from "../Icons/Moon"; | 17 | import {Moon} from "../Icons/Moon"; |
| 18 | import Trash from "../Icons/Trash"; | 18 | import Trash from "../Icons/Trash"; |
| 19 | import {DarkModeContext} from "../../contexts/DarkMode"; | ||
| 19 | 20 | ||
| 20 | interface Config { | 21 | interface Config { |
| 21 | url: string | 22 | url: string |
| @@ -49,7 +50,7 @@ const statusTextMap: ReadyStateMap = { | |||
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | export default function App() { | 52 | export default function App() { |
| 52 | const { darkMode, toggle } = useDarkMode(); | 53 | const { darkMode, toggle } = useContext(DarkModeContext); |
| 53 | const [config, setConfig]= useState<Config | null>(null) | 54 | const [config, setConfig]= useState<Config | null>(null) |
| 54 | 55 | ||
| 55 | const { calls, readyState, clear } = useRequests({ | 56 | const { calls, readyState, clear } = useRequests({ |
