diff --git a/client/coral-embed-stream/src/CommentStream.js b/client/coral-embed-stream/src/CommentStream.js index 26142a311..40ad72a41 100644 --- a/client/coral-embed-stream/src/CommentStream.js +++ b/client/coral-embed-stream/src/CommentStream.js @@ -28,7 +28,7 @@ import SuspendedAccount from '../../coral-framework/components/SuspendedAccount' const {addItem, updateItem, postItem, getStream, postAction, deleteAction, appendItemArray} = itemActions; const {addNotification, clearNotification} = notificationActions; -const {logout} = authActions; +const {logout, showSignInDialog} = authActions; class CommentStream extends Component { @@ -129,6 +129,7 @@ class CommentStream extends Component { addNotification={this.props.addNotification} id={commentId} like={actions[comment.like]} + showSignInDialog={this.props.showSignInDialog} postAction={this.props.postAction} deleteAction={this.props.deleteAction} addItem={this.props.addItem} @@ -143,6 +144,7 @@ class CommentStream extends Component { postAction={this.props.postAction} deleteAction={this.props.deleteAction} addItem={this.props.addItem} + showSignInDialog={this.props.showSignInDialog} updateItem={this.props.updateItem} currentUser={this.props.auth.user}/> @@ -189,6 +192,7 @@ class CommentStream extends Component { id={replyId} flag={this.props.items.actions[reply.flag]} postAction={this.props.postAction} + showSignInDialog={this.props.showSignInDialog} deleteAction={this.props.deleteAction} addItem={this.props.addItem} updateItem={this.props.updateItem} @@ -253,6 +257,7 @@ const mapDispatchToProps = (dispatch) => ({ getStream: (rootId) => dispatch(getStream(rootId)), addNotification: (type, text) => dispatch(addNotification(type, text)), clearNotification: () => dispatch(clearNotification()), + showSignInDialog: () => dispatch(showSignInDialog()), postAction: (item, action, user, itemType) => dispatch(postAction(item, action, user, itemType)), deleteAction: (item, action, user, itemType) => dispatch(deleteAction(item, action, user, itemType)), appendItemArray: (item, property, value, addToFront, itemType) => dispatch(appendItemArray(item, property, value, addToFront, itemType)), diff --git a/client/coral-plugin-flags/FlagButton.js b/client/coral-plugin-flags/FlagButton.js index cbb0fef63..f0ab1b22f 100644 --- a/client/coral-plugin-flags/FlagButton.js +++ b/client/coral-plugin-flags/FlagButton.js @@ -4,10 +4,11 @@ import translations from './translations.json'; const name = 'coral-plugin-flags'; -const FlagButton = ({flag, id, postAction, deleteAction, addItem, updateItem, addNotification, currentUser}) => { +const FlagButton = ({flag, id, postAction, deleteAction, addItem, showSignInDialog, updateItem, addNotification, currentUser}) => { const flagged = flag && flag.current_user; const onFlagClick = () => { if (!currentUser) { + showSignInDialog(); return; } if (!flagged) { diff --git a/client/coral-plugin-likes/LikeButton.js b/client/coral-plugin-likes/LikeButton.js index 07f27c426..b3d31fbf4 100644 --- a/client/coral-plugin-likes/LikeButton.js +++ b/client/coral-plugin-likes/LikeButton.js @@ -4,10 +4,11 @@ import translations from './translations.json'; const name = 'coral-plugin-flags'; -const LikeButton = ({like, id, postAction, deleteAction, addItem, updateItem, currentUser}) => { +const LikeButton = ({like, id, postAction, deleteAction, addItem, showSignInDialog, updateItem, currentUser}) => { const liked = like && like.current_user; const onLikeClick = () => { if (!currentUser) { + showSignInDialog(); return; } if (!liked) {