TESTING Added onShare to StatusContainer

TESTING

• Added:
- onShare to StatusContainer
This commit is contained in:
mgabdev 2020-10-24 14:18:36 -05:00
parent 651e2bd381
commit 0a46f54b7f
1 changed files with 23 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import {
MODAL_BOOST,
MODAL_CONFIRM,
POPOVER_COMMENT_SORTING_OPTIONS,
POPOVER_STATUS_SHARE,
COMMENT_SORTING_TYPE_OLDEST,
COMMENT_SORTING_TYPE_NEWEST,
COMMENT_SORTING_TYPE_TOP,
@ -301,6 +302,28 @@ const mapDispatchToProps = (dispatch) => ({
}
},
onShare (targetRef, status) {
if (!!navigator && navigator.share) {
console.log("CAN SHARE")
const url = this.props.status.get('url')
navigator.share({
url,
title: 'Test title',
text: 'Check out gab',
}).then(() => {
console.log('Successful share')
}).catch((error) => {
console.log('Error sharing', error)
})
} else {
dispatch(openPopover(POPOVER_STATUS_SHARE, {
targetRef,
status,
position: 'top',
}))
}
},
onCommentSortOpen(targetRef, callback) {
dispatch(openPopover(POPOVER_COMMENT_SORTING_OPTIONS, {
targetRef,