- {this.props.canShare ? shareButton : (
+ {this.props.canShare ? (
+ (this.props.isShowingProject || this.props.isUpdating) && (
+
+ {
+ setRequesting => (
+ {
+ this.handleClickShare(setRequesting);
+ }}
+ /* eslint-enable react/jsx-no-bind */
+ />
+ )
+ }
+
+ )
+ ) : (
this.props.showComingSoon ? (
- {shareButton}
+
) : []
)}
@@ -478,37 +491,27 @@ class MenuBar extends React.Component {
{this.props.enableCommunity ? (
-
+ (this.props.isShowingProject || this.props.isUpdating) && (
+
+ {
+ setRequesting => (
+ {
+ this.handleClickSeeCommunity(setRequesting);
+ }}
+ /* eslint-enable react/jsx-no-bind */
+ />
+ )
+ }
+
+ )
) : (this.props.showComingSoon ? (
) : [])}
diff --git a/src/components/menu-bar/share-button.css b/src/components/menu-bar/share-button.css
new file mode 100644
index 000000000..09452684c
--- /dev/null
+++ b/src/components/menu-bar/share-button.css
@@ -0,0 +1,10 @@
+@import "../../css/colors.css";
+
+.share-button {
+ background: $data-primary;
+}
+
+.share-button-is-shared {
+ background: $ui-black-transparent;
+ cursor: default;
+}
diff --git a/src/components/menu-bar/share-button.jsx b/src/components/menu-bar/share-button.jsx
new file mode 100644
index 000000000..7513867ee
--- /dev/null
+++ b/src/components/menu-bar/share-button.jsx
@@ -0,0 +1,48 @@
+import classNames from 'classnames';
+import {FormattedMessage} from 'react-intl';
+import PropTypes from 'prop-types';
+import React from 'react';
+import Button from '../button/button.jsx';
+
+import styles from './share-button.css';
+
+const ShareButton = ({
+ className,
+ isShared,
+ onClick
+}) => (
+