Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Oct 31, 2024
1 parent 01c02bc commit 54c8712
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const meta = {
refs: {},
status: {},
showCreateStoryButton: true,
isDevelopment: true,
},
decorators: [
(storyFn) => (
Expand Down
3 changes: 2 additions & 1 deletion code/core/src/manager/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/manager/components/sidebar/SidebarBottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const SidebarBottomBase = ({
api,
notifications = [],
status = {},
isDevelopment = globalThis.CONFIG_TYPE === 'DEVELOPMENT',
isDevelopment,
}: SidebarBottomProps) => {
const spacerRef = useRef<HTMLDivElement | null>(null);
const wrapperRef = useRef<HTMLDivElement | null>(null);
Expand Down

0 comments on commit 54c8712

Please sign in to comment.