Added missing props, functions to Comment

• Added:
- missing props, functions to Comment for showMedia and onOpenMedia
This commit is contained in:
mgabdev 2020-06-05 09:14:09 -04:00
parent 451f2c7dbb
commit b7df605012

View File

@ -76,6 +76,9 @@ const mapDispatchToProps = (dispatch) => ({
status, status,
})) }))
}, },
onOpenMedia (media, index) {
dispatch(openModal('MEDIA', { media, index }));
},
}) })
export default export default
@ -101,6 +104,7 @@ class Comment extends ImmutablePureComponent {
onOpenLikes: PropTypes.func.isRequired, onOpenLikes: PropTypes.func.isRequired,
onOpenReposts: PropTypes.func.isRequired, onOpenReposts: PropTypes.func.isRequired,
onOpenStatusRevisionsPopover: PropTypes.func.isRequired, onOpenStatusRevisionsPopover: PropTypes.func.isRequired,
onOpenMedia: PropTypes.func.isRequired
} }
updateOnProps = [ updateOnProps = [
@ -133,6 +137,10 @@ class Comment extends ImmutablePureComponent {
this.props.onOpenStatusOptions(this.moreNode, this.props.status) this.props.onOpenStatusOptions(this.moreNode, this.props.status)
} }
handleToggleMediaVisibility = () => {
this.setState({ showMedia: !this.state.showMedia })
}
setMoreNode = (c) => { setMoreNode = (c) => {
this.moreNode = c this.moreNode = c
} }
@ -208,7 +216,6 @@ class Comment extends ImmutablePureComponent {
visible={this.state.showMedia} visible={this.state.showMedia}
onToggleVisibility={this.handleToggleMediaVisibility} onToggleVisibility={this.handleToggleMediaVisibility}
width={this.props.cachedMediaWidth} width={this.props.cachedMediaWidth}
onOpenVideo={this.handleOpenVideo}
/> />
</div> </div>
</div> </div>