Skip to content

Commit

Permalink
fix(documentation): edit on Github breaks page without stories attached
Browse files Browse the repository at this point in the history
  • Loading branch information
imagoiq committed Nov 13, 2023
1 parent 212dcb4 commit cca4329
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/documentation/.storybook/blocks/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default (props: PropsWithChildren<DocsContainerProps>) => {
context.channel.data.docsPrepared[0].parameters.layout === 'fullscreen'
? 'container-fluid'
: 'container';
const pathToStoryFile = context.storyIdToCSFFile.values().next().value.meta.parameters.fileName;
const pathToStoryFile = context?.storyIdToCSFFile?.values()?.next()?.value?.meta
?.parameters?.fileName;
return (
<DocsContainer context={context}>
<Unstyled>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Meta } from '@storybook/blocks';
import { Search } from './search-icons.blocks';
import * as SearchIcons from './search-icons.stories';

<Meta title="Icons/Search for Icons" />
<Meta of={SearchIcons} />

# Search for icons

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Meta, StoryObj } from '@storybook/web-components';

const meta: Meta = {
title: 'Icons/Search for Icons',
};

export default meta;

type Story = StoryObj;

export const Default: Story = {};
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Markdown, Meta } from '@storybook/blocks';
import changelog from '../../../../../styles/CHANGELOG.md?raw';
import { CodeOrSourceMdx } from '../../utilities/markdown/CodeOrSourceMdx';
import ChangelogStories from './changelog.stories';

<Meta
title="Misc/Changelog"
/>
<Meta of={ChangelogStories}/>

<Markdown options={{ overrides: { code: CodeOrSourceMdx } }}>{changelog}</Markdown>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Meta, StoryObj } from '@storybook/web-components';

const meta: Meta = {
title: 'Misc/Changelog',
};

export default meta;

type Story = StoryObj;

export const Default: Story = {};

0 comments on commit cca4329

Please sign in to comment.