diff --git a/space_flow/src/contexts/locationContext.tsx b/space_flow/src/contexts/locationContext.tsx
index 1f3fe2378..3850f8a1c 100644
--- a/space_flow/src/contexts/locationContext.tsx
+++ b/space_flow/src/contexts/locationContext.tsx
@@ -1,45 +1,79 @@
import { createContext, useState } from "react";
-type locationContextType=
-{
- atual:Array
;
- setAtual:(newState:Array)=>void;
- isStackedOpen: boolean;
- setIsStackedOpen:(newState:boolean)=>void;
- showSideBar:boolean;
- setShowSideBar:(newState:boolean)=>void;
- extraNavigation:{title:string, options?:Array<{name:string, href:string, icon: any, children?:Array}>};
- setExtraNavigation:(newState:{title:string, options?:Array<{name:string, href:string, icon: any, children?:Array}>}) => void;
- extraComponent:any;
- setExtraComponent:(newState:any) => void;
-}
-
-const initialValue= {
- atual : window.location.pathname.replace(/\/$/g, '').split("/"),
- isStackedOpen:((window.innerWidth > 1024 && window.location.pathname.split("/")[1]) ? true : false),
- setAtual: ()=>{},
- setIsStackedOpen:()=>{},
- showSideBar: window.location.pathname.split("/")[1]?true:false,
- setShowSideBar:()=>{},
- extraNavigation: {title:""},
- setExtraNavigation:()=>{},
- extraComponent: <>>,
- setExtraComponent:()=>{},
-}
-
+//types for location context
+type locationContextType = {
+ current: Array;
+ setCurrent: (newState: Array) => void;
+ isStackedOpen: boolean;
+ setIsStackedOpen: (newState: boolean) => void;
+ showSideBar: boolean;
+ setShowSideBar: (newState: boolean) => void;
+ extraNavigation: {
+ title: string;
+ options?: Array<{
+ name: string;
+ href: string;
+ icon: any;
+ children?: Array;
+ }>;
+ };
+ setExtraNavigation: (newState: {
+ title: string;
+ options?: Array<{
+ name: string;
+ href: string;
+ icon: any;
+ children?: Array;
+ }>;
+ }) => void;
+ extraComponent: any;
+ setExtraComponent: (newState: any) => void;
+};
+//initial value for location context
+const initialValue = {
+ //actual
+ current: window.location.pathname.replace(/\/$/g, "").split("/"),
+ isStackedOpen:
+ window.innerWidth > 1024 && window.location.pathname.split("/")[1]
+ ? true
+ : false,
+ setCurrent: () => {},
+ setIsStackedOpen: () => {},
+ showSideBar: window.location.pathname.split("/")[1] ? true : false,
+ setShowSideBar: () => {},
+ extraNavigation: { title: "" },
+ setExtraNavigation: () => {},
+ extraComponent: <>>,
+ setExtraComponent: () => {},
+};
export const locationContext = createContext(initialValue);
-export function LocationProvider({children}){
- const [atual,setAtual] = useState(initialValue.atual)
- const [isStackedOpen,setIsStackedOpen] = useState(initialValue.isStackedOpen)
- const [showSideBar,setShowSideBar] = useState(initialValue.showSideBar)
- const [extraNavigation, setExtraNavigation] = useState({title:""})
- const [extraComponent, setExtraComponent] = useState(<>>)
- return (
-
- {children}
-
- )
+export function LocationProvider({ children }) {
+ const [current, setCurrent] = useState(initialValue.current);
+ const [isStackedOpen, setIsStackedOpen] = useState(
+ initialValue.isStackedOpen
+ );
+ const [showSideBar, setShowSideBar] = useState(initialValue.showSideBar);
+ const [extraNavigation, setExtraNavigation] = useState({ title: "" });
+ const [extraComponent, setExtraComponent] = useState(<>>);
+ return (
+
+ {children}
+
+ );
}