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

@@ -15,9 +15,9 @@ import debounce from "lodash/debounce";
import { Icon, LoadingIndicator } from "src/components/Shared";
import { useInterval, usePageVisibility } from "src/hooks";
import { useConfiguration } from "src/core/StashService";
import { FormattedMessage, useIntl } from "react-intl";
import { DisplayMode, LightboxImage, ScrollMode } from "./LightboxImage";
import { ConfigurationContext } from "../Config";
const CLASSNAME = "Lightbox";
const CLASSNAME_HEADER = `${CLASSNAME}-header`;
@@ -93,11 +93,10 @@ export const LightboxComponent: React.FC<IProps> = ({
const allowNavigation = images.length > 1 || pageCallback;
const intl = useIntl();
const config = useConfiguration();
const { configuration: config } = React.useContext(ConfigurationContext);
const userSelectedSlideshowDelayOrDefault =
config?.data?.configuration.interface.slideshowDelay ??
DEFAULT_SLIDESHOW_DELAY;
config?.interface.slideshowDelay ?? DEFAULT_SLIDESHOW_DELAY;
// slideshowInterval is used for controlling the logic
// displaySlideshowInterval is for display purposes only