mirror of
https://github.com/gnmyt/myspeed.git
synced 2026-04-26 14:39:01 -05:00
Remove View context completely
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
import React, {useState, createContext} from "react";
|
||||
|
||||
export const ViewContext = createContext({});
|
||||
|
||||
export const ViewProvider = (props) => {
|
||||
const [view, setView] = useState(parseInt(localStorage.getItem("view")) || 0);
|
||||
|
||||
const updateView = (newView) => {
|
||||
setView(newView);
|
||||
localStorage.setItem("view", newView);
|
||||
}
|
||||
|
||||
return (
|
||||
<ViewContext.Provider value={[view, updateView]}>
|
||||
{props.children}
|
||||
</ViewContext.Provider>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export * from './ViewContext';
|
||||
Reference in New Issue
Block a user