diff --git a/package.json b/package.json index e111c44..aa761b6 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "testonly": "mocha --require .scripts/mocha_runner src/**/tests/**/*.js", "test": "npm run lint && npm run testonly", "test-watch": "npm run testonly -- --watch --watch-extensions js", - "storybook": "STORYBOOK_CLOUD_SERVER='http://localhost:3003/graphql' STORYBOOK_CLOUD_APPID='test-app' STORYBOOK_CLOUD_DATABASE='test-db' start-storybook -p 3006", +    "storybook": "start-storybook -p 3006", "storybook-local": "STORYBOOK_CLOUD_SERVER='http://localhost:3003/graphql' start-storybook -p 9010", "storybook-remote": "start-storybook -p 3006", "publish-storybook": "bash .scripts/publish_storybook.sh" diff --git a/src/manager/components/CommentForm/index.js b/src/manager/components/CommentForm/index.js index 2d59be2..024d20c 100644 --- a/src/manager/components/CommentForm/index.js +++ b/src/manager/components/CommentForm/index.js @@ -41,6 +41,11 @@ export default class CommentForm extends Component { this.setState({ text: '' }); } + openLogin() { + const signInUrl = `https://hub.getstorybook.io/sign-in?redirectUrl=${encodeURIComponent(location.href)}`; + location.href = signInUrl; + } + handleKeyDown(e) { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); @@ -49,6 +54,22 @@ export default class CommentForm extends Component { } render() { + if (!this.props.user) { + return ( +
+