From ca8e8e3f087473cf2eddfdda93665f4bcb614767 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 17:30:41 -0300 Subject: [PATCH] refactor[locationContext]: Move type locationContextType to types directorie --- src/frontend/src/contexts/locationContext.tsx | 31 +------------------ src/frontend/src/types/typesContext/index.ts | 29 +++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/frontend/src/contexts/locationContext.tsx b/src/frontend/src/contexts/locationContext.tsx index 474062d69..b0a9ef8c5 100644 --- a/src/frontend/src/contexts/locationContext.tsx +++ b/src/frontend/src/contexts/locationContext.tsx @@ -1,34 +1,5 @@ import { createContext, ReactNode, useState } from "react"; - -//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; -}; +import { locationContextType } from "../types/typesContext"; //initial value for location context const initialValue = { diff --git a/src/frontend/src/types/typesContext/index.ts b/src/frontend/src/types/typesContext/index.ts index f0debe77a..76a1fc17c 100644 --- a/src/frontend/src/types/typesContext/index.ts +++ b/src/frontend/src/types/typesContext/index.ts @@ -43,3 +43,32 @@ export type darkContextType = { dark: {}; setDark: (newState: {}) => void; }; + +export 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; +};