refactor context wrapper

This commit is contained in:
anovazzi1 2023-02-27 14:13:46 -03:00
commit ab1a4c9801
2 changed files with 121 additions and 122 deletions

View file

@ -18,8 +18,7 @@ import { TabsManager } from "./pages/FlowPage/flowManager";
export default function App() { export default function App() {
var _ = require("lodash"); var _ = require("lodash");
let { setAtual, setShowSideBar, setIsStackedOpen } =
let { setAtual, setShowSideBar, setIsStackedOpen} =
useContext(locationContext); useContext(locationContext);
let location = useLocation(); let location = useLocation();
useEffect(() => { useEffect(() => {
@ -98,7 +97,6 @@ export default function App() {
return ( return (
//need parent component with width and height //need parent component with width and height
<div className="h-full flex flex-col"> <div className="h-full flex flex-col">
<div className="flex grow-0 shrink basis-auto"> <div className="flex grow-0 shrink basis-auto">
<Header userNavigation={userNavigation} user={user}></Header> <Header userNavigation={userNavigation} user={user}></Header>
</div> </div>

View file

@ -5,6 +5,7 @@ import { TabsProvider } from "./tabsContext";
import { TypesProvider } from "./typesContext"; import { TypesProvider } from "./typesContext";
export default function ContextWrapper({ children }) { export default function ContextWrapper({ children }) {
//element to wrap all context
return ( return (
<> <>
<LocationProvider> <LocationProvider>