refactor[locationContext]: Move type locationContextType to types directorie
This commit is contained in:
parent
2c8b0e1aaf
commit
ca8e8e3f08
2 changed files with 30 additions and 30 deletions
|
|
@ -1,34 +1,5 @@
|
||||||
import { createContext, ReactNode, useState } from "react";
|
import { createContext, ReactNode, useState } from "react";
|
||||||
|
import { locationContextType } from "../types/typesContext";
|
||||||
//types for location context
|
|
||||||
type locationContextType = {
|
|
||||||
current: Array<string>;
|
|
||||||
setCurrent: (newState: Array<string>) => 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<any>;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
setExtraNavigation: (newState: {
|
|
||||||
title: string;
|
|
||||||
options?: Array<{
|
|
||||||
name: string;
|
|
||||||
href: string;
|
|
||||||
icon: any;
|
|
||||||
children?: Array<any>;
|
|
||||||
}>;
|
|
||||||
}) => void;
|
|
||||||
extraComponent: any;
|
|
||||||
setExtraComponent: (newState: any) => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
//initial value for location context
|
//initial value for location context
|
||||||
const initialValue = {
|
const initialValue = {
|
||||||
|
|
|
||||||
|
|
@ -43,3 +43,32 @@ export type darkContextType = {
|
||||||
dark: {};
|
dark: {};
|
||||||
setDark: (newState: {}) => void;
|
setDark: (newState: {}) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type locationContextType = {
|
||||||
|
current: Array<string>;
|
||||||
|
setCurrent: (newState: Array<string>) => 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<any>;
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
setExtraNavigation: (newState: {
|
||||||
|
title: string;
|
||||||
|
options?: Array<{
|
||||||
|
name: string;
|
||||||
|
href: string;
|
||||||
|
icon: any;
|
||||||
|
children?: Array<any>;
|
||||||
|
}>;
|
||||||
|
}) => void;
|
||||||
|
extraComponent: any;
|
||||||
|
setExtraComponent: (newState: any) => void;
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue