Skip to content

Commit 46024d3

Browse files
committed
fix stories
1 parent ef2a07e commit 46024d3

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

packages/styleguide/.storybook/components/Elements/DocsContainer.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,14 @@ export const DocsContainer: React.FC<{
7070
* This is admittedly a bit fragile - when updating Storybook this likely will need to be changed
7171
*/
7272
// Try multiple sources for storyId since it can be in different places depending on environment
73-
const storyIdFromSpecified = (context?.channel as any)?.data
74-
?.storySpecified?.[0]?.storyId;
75-
const storyIdFromCurrent = (context?.channel as any)?.data
76-
?.currentStoryWasSet?.[0]?.storyId;
77-
const storyId = storyIdFromSpecified || storyIdFromCurrent;
73+
74+
const storyId = (context?.channel as any)?.data?.currentStoryWasSet?.[0]
75+
?.storyId;
7876

7977
const globalTheme =
8078
(context as any).store.userGlobals?.globals?.theme || 'core';
8179

82-
const { selectedTheme, currentTheme } = useMemo(() => {
80+
const { currentTheme } = useMemo(() => {
8381
const findThemeStory: keyof typeof themeSpecificStories | undefined =
8482
storyId;
8583

@@ -97,11 +95,7 @@ export const DocsContainer: React.FC<{
9795
};
9896
}, [storyId, globalTheme]);
9997

100-
// Debug logging
101-
console.log('storyIdFromSpecified:', storyIdFromSpecified);
102-
console.log('storyIdFromCurrent:', storyIdFromCurrent);
103-
console.log('final storyId:', storyId);
104-
console.log('selectedTheme:', selectedTheme);
98+
// Debuglogging
10599

106100
return (
107101
<StorybookDocsContainer theme={theme} context={context} {...rest}>

0 commit comments

Comments
 (0)