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,
|
|
|
|
dispatchBadgeState: 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);
|