Skip to content

Commit

Permalink
fix: stories display story name
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Sep 15, 2020
1 parent e2fba85 commit 43b9174
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/blocks/src/Stories/Stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
useStory,
useCurrentDocument,
StoryInputProps,
useStore,
} from '@component-controls/store';
import { StoryBlockContainer } from '../BlockContainer/story';
import { StoryPlayground, StoryPlaygroundProps } from '../Playground';
Expand All @@ -25,6 +26,7 @@ export type StoriesProps = StoriesOwnProps &
export const Stories: FC<StoriesProps> = ({ id, name, title, ...rest }) => {
const story = useStory({ id, name });
const doc = useCurrentDocument();
const store = useStore();
const stories = doc?.stories
? doc.stories.filter((id: string) => !story || story.id !== id)
: [];
Expand All @@ -34,9 +36,10 @@ export const Stories: FC<StoriesProps> = ({ id, name, title, ...rest }) => {
return (
<StoryBlockContainer title={title} {...rest}>
{stories.map((id: string) => {
const story = store.stories[id];
return (
<StoryPlayground
title="."
title={story.name}
id={id}
collapsible={false}
key={`playground-${id}`}
Expand Down

0 comments on commit 43b9174

Please sign in to comment.