diff --git a/code/core/src/manager/components/sidebar/Sidebar.stories.tsx b/code/core/src/manager/components/sidebar/Sidebar.stories.tsx index d4698f53e6df..dcc6b06096c2 100644 --- a/code/core/src/manager/components/sidebar/Sidebar.stories.tsx +++ b/code/core/src/manager/components/sidebar/Sidebar.stories.tsx @@ -85,6 +85,7 @@ const meta = { refs: {}, status: {}, showCreateStoryButton: true, + isDevelopment: true, }, decorators: [ (storyFn) => ( diff --git a/code/core/src/manager/components/sidebar/Sidebar.tsx b/code/core/src/manager/components/sidebar/Sidebar.tsx index 94ce7927965b..bb3be73f425d 100644 --- a/code/core/src/manager/components/sidebar/Sidebar.tsx +++ b/code/core/src/manager/components/sidebar/Sidebar.tsx @@ -109,7 +109,6 @@ const useCombination = ( return useMemo(() => ({ hash, entries: Object.entries(hash) }), [hash]); }; -const isDevelopment = global.CONFIG_TYPE === 'DEVELOPMENT'; const isRendererReact = global.STORYBOOK_RENDERER === 'react'; export interface SidebarProps extends API_LoadedRefData { @@ -124,6 +123,7 @@ export interface SidebarProps extends API_LoadedRefData { onMenuClick?: HeadingProps['onMenuClick']; showCreateStoryButton?: boolean; indexJson?: StoryIndex; + isDevelopment?: boolean; } export const Sidebar = React.memo(function Sidebar({ // @ts-expect-error (non strict) @@ -138,6 +138,7 @@ export const Sidebar = React.memo(function Sidebar({ extra, menuHighlighted = false, enableShortcuts = true, + isDevelopment = global.CONFIG_TYPE === 'DEVELOPMENT', refs = {}, onMenuClick, showCreateStoryButton = isDevelopment && isRendererReact, diff --git a/code/core/src/manager/components/sidebar/SidebarBottom.tsx b/code/core/src/manager/components/sidebar/SidebarBottom.tsx index c2e0a242866e..f6aae845bee3 100644 --- a/code/core/src/manager/components/sidebar/SidebarBottom.tsx +++ b/code/core/src/manager/components/sidebar/SidebarBottom.tsx @@ -99,7 +99,7 @@ export const SidebarBottomBase = ({ api, notifications = [], status = {}, - isDevelopment = globalThis.CONFIG_TYPE === 'DEVELOPMENT', + isDevelopment, }: SidebarBottomProps) => { const spacerRef = useRef(null); const wrapperRef = useRef(null);