diff --git a/src/contexts/AuthContext.ts b/src/contexts/AuthContext.ts index b3820ed318ceae918df2736d9372ae527b8423a0..37ede1f49420d6c728b2eac8037c7b9a1fbe451a 100644 --- a/src/contexts/AuthContext.ts +++ b/src/contexts/AuthContext.ts @@ -1,6 +1,6 @@ import { createContext, useContext } from "react"; -export interface User { +interface User { fullName?: string; loginName?: string; avatar?: string; @@ -38,7 +38,7 @@ const defaultValue: AuthContextProps = { export const AuthContext = createContext<AuthContextProps>(defaultValue); -export const useUserContext = () => { +export const useAuthContext = () => { const { user, userRoles, diff --git a/src/contexts/GlobalAppBarContext.ts b/src/contexts/GlobalAppBarContext.ts index a87150a1adcae044f73491b15a4c74a40b631399..0a631d04afa8006130f18b06c11f920d0419de86 100644 --- a/src/contexts/GlobalAppBarContext.ts +++ b/src/contexts/GlobalAppBarContext.ts @@ -1,6 +1,6 @@ import { createContext, useContext } from "react"; -interface GlobalAppContext { +export interface GlobalAppContext { title: string; setTitle: (title: string) => void; } diff --git a/src/contexts/index.ts b/src/contexts/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..45be9ebe6884eff4d13ef24ede42fb8f0d2ff5f9 --- /dev/null +++ b/src/contexts/index.ts @@ -0,0 +1,12 @@ +import { AuthContext, useAuthContext } from "./AuthContext"; +import { + GlobalAppBarContext, + useGlobalAppBarContext +} from "./GlobalAppBarContext"; + +export { + AuthContext, + useAuthContext, + GlobalAppBarContext, + useGlobalAppBarContext +}; diff --git a/src/index.js b/src/index.js index c0581f782a7000fb912b9ad30791cb5966e471de..683928af36cda9e27f32eb1453cb47a26e387dba 100644 --- a/src/index.js +++ b/src/index.js @@ -1,8 +1,7 @@ export * from "./hooks/usePagination"; export * from "./hooks/useTypingTimer"; export * from "./hooks/useUniqueKeys"; -export * from "./contexts/AuthContext"; -export * from "./contexts/GlobalAppBarContext"; +export * from "./contexts"; export * from "./components/common/AlertBanner"; export * from "./components/common/ApiAlertError"; export * from "./components/common/AppLayout";