Skip to content

Commit

Permalink
Merge pull request #68 from kadirahq/custom-preview-api
Browse files Browse the repository at this point in the history
Use new addon API to get preview component
  • Loading branch information
Muhammed Thanish authored Aug 29, 2016
2 parents a4946b6 + 96a3031 commit afe8f53
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dist/manager/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ var ReactProvider = function (_Provider) {
value: function renderPreview(kind, story) {
this.selection = { kind: kind, story: story };
this.channel.emit('setCurrentStory', { kind: kind, story: story });
var renderPreview = _storybookAddons2.default.getPreview();
if (renderPreview) {
return renderPreview(kind, story);
}
return null;
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"@kadira/storybook-addon-actions": "^1.0.4",
"@kadira/storybook-addon-links": "^1.0.1",
"@kadira/storybook-addons": "^1.3.1",
"@kadira/storybook-addons": "^1.4.0",
"@kadira/storybook-channel-websocket": "^1.0.1",
"@kadira/storybook-ui": "^3.3.1",
"autoprefixer": "^6.4.0",
Expand Down
4 changes: 4 additions & 0 deletions src/manager/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default class ReactProvider extends Provider {
renderPreview(kind, story) {
this.selection = { kind, story };
this.channel.emit('setCurrentStory', { kind, story });
const renderPreview = addons.getPreview();
if (renderPreview) {
return renderPreview(kind, story);
}
return null;
}

Expand Down

0 comments on commit afe8f53

Please sign in to comment.