mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
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:
28
ui/v2.5/src/hooks/Config.tsx
Normal file
28
ui/v2.5/src/hooks/Config.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user