mirror of
https://github.com/sergeyyarkov/educt-client.git
synced 2026-10-11 10:19:22 +03:00
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { createContext } from 'react';
|
|
import { ChangeEmailPageContextType, CoursesPageContextType, UsersPageContextType } from '@educt/types';
|
|
import RootStore from '../stores/RootStore';
|
|
import { Socket } from 'socket.io-client';
|
|
|
|
export const StoreContext = createContext<RootStore | undefined>(undefined);
|
|
|
|
export const SocketContext = createContext<{ socket: Socket | null }>({
|
|
socket: null,
|
|
});
|
|
|
|
export const ChangeEmailPageContext = createContext<ChangeEmailPageContextType>({
|
|
isCodeSent: false,
|
|
setIsCodeSent: () => null,
|
|
confirmEmailData: undefined,
|
|
setConfirmEmailData: () => null,
|
|
});
|
|
|
|
export const UsersPageContext = createContext<UsersPageContextType>({
|
|
searchingRole: undefined,
|
|
setSearchingRole: () => null,
|
|
searchingPage: 1,
|
|
setSearchingPage: () => null,
|
|
search: undefined,
|
|
setSearch: () => null,
|
|
});
|
|
|
|
export const CoursesPageContext = createContext<CoursesPageContextType>({
|
|
selectedCategory: undefined,
|
|
setSelectedCategory: () => null,
|
|
courseStatus: undefined,
|
|
setCourseStatus: () => null,
|
|
});
|