nitro-react/src/views/inventory/context/InventoryContext.tsx

22 lines
697 B
TypeScript
Raw Normal View History

2021-04-24 03:03:34 +02:00
import { createContext, FC, useContext } from 'react';
import { IInventoryContext, InventoryContextProps } from './InventoryContext.types';
const InventoryContext = createContext<IInventoryContext>({
2021-04-28 19:47:33 +02:00
furnitureState: null,
2021-04-29 10:03:40 +02:00
dispatchFurnitureState: null,
botState: null,
dispatchBotState: null,
petState: null,
dispatchPetState: null,
badgeState: null,
2021-07-16 19:17:52 +02:00
dispatchBadgeState: null,
unseenTracker: null
2021-04-24 03:03:34 +02:00
});
export const InventoryContextProvider: FC<InventoryContextProps> = props =>
{
return <InventoryContext.Provider value={ props.value }>{ props.children }</InventoryContext.Provider>
}
export const useInventoryContext = () => useContext(InventoryContext);