Add option to disable create from dropdown (#1814)

* Convert config hooks to common context
* Add option to disable creating from dropdown
This commit is contained in:
WithoutPants
2021-10-11 17:45:58 +11:00
committed by GitHub
parent 46ae4581b8
commit b5381ff071
24 changed files with 269 additions and 130 deletions

View File

@@ -0,0 +1,28 @@
import React from "react";
import * as GQL from "src/core/generated-graphql";
interface IContext {
configuration?: GQL.ConfigDataFragment;
loading?: boolean;
}
export const ConfigurationContext = React.createContext<IContext>({});
export const ConfigurationProvider: React.FC<IContext> = ({
loading,
configuration,
children,
}) => {
return (
<ConfigurationContext.Provider
value={{
configuration,
loading,
}}
>
{children}
</ConfigurationContext.Provider>
);
};
export default ConfigurationProvider;