diff --git a/addons/info/src/components/Story.js b/addons/info/src/components/Story.js index 7e412085cc4..618d64d4f31 100644 --- a/addons/info/src/components/Story.js +++ b/addons/info/src/components/Story.js @@ -125,11 +125,7 @@ export default class Story extends React.Component { _renderInline() { return (
-
-
- {this._getInfoHeader()} -
-
+ {this._renderInlineHeader()}
{this._renderStory()}
@@ -145,6 +141,19 @@ export default class Story extends React.Component { ); } + _renderInlineHeader() { + const infoHeader = this._getInfoHeader(); + + return ( + infoHeader && +
+
+ {infoHeader} +
+
+ ); + } + _renderOverlay() { const linkStyle = { ...stylesheet.link.base, diff --git a/app/react-native/src/server/index.js b/app/react-native/src/server/index.js index ed284ab31b4..09e0a34284b 100755 --- a/app/react-native/src/server/index.js +++ b/app/react-native/src/server/index.js @@ -12,14 +12,12 @@ export default class Server { this.expressApp.use(storybook(options)); this.httpServer.on('request', this.expressApp); this.wsServer = new ws.Server({ server: this.httpServer }); - this.wsServer.on('connection', s => this.handleWS(s)); + this.wsServer.on('connection', (s, req) => this.handleWS(s, req)); } - handleWS(socket) { + handleWS(socket, req) { if (this.options.manualId) { - const params = socket.upgradeReq && socket.upgradeReq.url - ? querystring.parse(socket.upgradeReq.url.substr(1)) - : {}; + const params = req.url ? querystring.parse(req.url.substr(1)) : {}; if (params.pairedId) { socket.pairedId = params.pairedId; // eslint-disable-line