From b7df60501267c35e10436b1c17f4fd060558aeaf Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Fri, 5 Jun 2020 09:14:09 -0400 Subject: [PATCH] Added missing props, functions to Comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added: - missing props, functions to Comment for showMedia and onOpenMedia --- app/javascript/gabsocial/components/comment.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/javascript/gabsocial/components/comment.js b/app/javascript/gabsocial/components/comment.js index a19fb6dc..a1efcb42 100644 --- a/app/javascript/gabsocial/components/comment.js +++ b/app/javascript/gabsocial/components/comment.js @@ -76,6 +76,9 @@ const mapDispatchToProps = (dispatch) => ({ status, })) }, + onOpenMedia (media, index) { + dispatch(openModal('MEDIA', { media, index })); + }, }) export default @@ -101,6 +104,7 @@ class Comment extends ImmutablePureComponent { onOpenLikes: PropTypes.func.isRequired, onOpenReposts: PropTypes.func.isRequired, onOpenStatusRevisionsPopover: PropTypes.func.isRequired, + onOpenMedia: PropTypes.func.isRequired } updateOnProps = [ @@ -133,6 +137,10 @@ class Comment extends ImmutablePureComponent { this.props.onOpenStatusOptions(this.moreNode, this.props.status) } + handleToggleMediaVisibility = () => { + this.setState({ showMedia: !this.state.showMedia }) + } + setMoreNode = (c) => { this.moreNode = c } @@ -208,7 +216,6 @@ class Comment extends ImmutablePureComponent { visible={this.state.showMedia} onToggleVisibility={this.handleToggleMediaVisibility} width={this.props.cachedMediaWidth} - onOpenVideo={this.handleOpenVideo} />