1
1
import React , {
2
- createContext ,
3
2
useContext ,
4
3
useEffect ,
5
4
useRef ,
6
5
} from "react" ;
7
6
7
+ import { NotificationContext } from "../contexts/NotificationContextProvider" ;
8
+ import {
9
+ updateWindowUrlHashParams ,
10
+ URL_HASH_PARAMS_DEFAULT ,
11
+ URL_SEARCH_PARAMS_DEFAULT ,
12
+ UrlContext ,
13
+ } from "../contexts/UrlContextProvider" ;
8
14
import useContextStore from "../stores/contextStore" ;
9
15
import useLogFileManagerStore from "../stores/logFileManagerProxyStore" ;
10
16
import useLogFileStore from "../stores/logFileStore" ;
@@ -22,21 +28,8 @@ import {
22
28
isWithinBounds ,
23
29
} from "../utils/data" ;
24
30
import { clamp } from "../utils/math" ;
25
- import { NotificationContext } from "./NotificationContextProvider" ;
26
- import {
27
- updateWindowUrlHashParams ,
28
- URL_HASH_PARAMS_DEFAULT ,
29
- URL_SEARCH_PARAMS_DEFAULT ,
30
- UrlContext ,
31
- } from "./UrlContextProvider" ;
32
31
33
32
34
- const StateContext = createContext < null > ( null ) ;
35
-
36
- interface StateContextProviderProps {
37
- children : React . ReactNode ;
38
- }
39
-
40
33
/**
41
34
* Updates the log event number in the URL to `logEventNum` if it's within the bounds of
42
35
* `logEventNumsOnPage`.
@@ -75,14 +68,18 @@ const updateUrlIfEventOnPage = (
75
68
return true ;
76
69
} ;
77
70
71
+ interface AppControllerProps {
72
+ children : React . ReactNode ;
73
+ }
74
+
78
75
/**
79
76
* Manages states for the application.
80
77
*
81
78
* @param props
82
79
* @param props.children
83
80
* @return
84
81
*/
85
- const AppController = ( { children} : StateContextProviderProps ) => {
82
+ const AppController = ( { children} : AppControllerProps ) => {
86
83
const { postPopUp} = useContext ( NotificationContext ) ;
87
84
const { filePath, isPrettified, logEventNum} = useContext ( UrlContext ) ;
88
85
@@ -189,14 +186,8 @@ const AppController = ({children}: StateContextProviderProps) => {
189
186
setPostPopUp ,
190
187
] ) ;
191
188
192
-
193
- return (
194
- < StateContext . Provider value = { null } >
195
- { children }
196
- </ StateContext . Provider >
197
- ) ;
189
+ return children ;
198
190
} ;
199
191
200
192
201
193
export default AppController ;
202
- export { StateContext } ;
0 commit comments