Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created February 10, 2020 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/8475e494dc2744e03a36dc3147e436fb to your computer and use it in GitHub Desktop.
Save IntegerMan/8475e494dc2744e03a36dc3147e436fb to your computer and use it in GitHub Desktop.
import {select, text, withKnobs} from '@storybook/addon-knobs';
import {moduleMetadata, storiesOf} from '@storybook/angular';
import {StoryEntry} from '../../Model/StoryEntry';
import {StoryEntryType} from '../../Model/StoryEntryType';
import {AppModule} from '../app.module';
import {StoryEntryComponent} from './story-entry.component';
storiesOf('StoryEntry', module)
.addDecorator(moduleMetadata({ imports: [ AppModule ]}))
.addDecorator(withKnobs)
.add('Configurable', () => ({
component: StoryEntryComponent,
props: {
Entry: new StoryEntry(select<StoryEntryType>('Type',
{Error: StoryEntryType.CommandError,
System: StoryEntryType.SystemText,
Narrative: StoryEntryType.StoryNarrative,
Command: StoryEntryType.PlayerCommand},
StoryEntryType.SystemText),
text('Text', 'This is the text of the entry'))
},
})); // Note: non-configurable stories omitted for brevity / focus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment