TESTING Added onShare to StatusContainer
TESTING • Added: - onShare to StatusContainer
This commit is contained in:
parent
651e2bd381
commit
0a46f54b7f
@ -33,6 +33,7 @@ import {
|
|||||||
MODAL_BOOST,
|
MODAL_BOOST,
|
||||||
MODAL_CONFIRM,
|
MODAL_CONFIRM,
|
||||||
POPOVER_COMMENT_SORTING_OPTIONS,
|
POPOVER_COMMENT_SORTING_OPTIONS,
|
||||||
|
POPOVER_STATUS_SHARE,
|
||||||
COMMENT_SORTING_TYPE_OLDEST,
|
COMMENT_SORTING_TYPE_OLDEST,
|
||||||
COMMENT_SORTING_TYPE_NEWEST,
|
COMMENT_SORTING_TYPE_NEWEST,
|
||||||
COMMENT_SORTING_TYPE_TOP,
|
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) {
|
onCommentSortOpen(targetRef, callback) {
|
||||||
dispatch(openPopover(POPOVER_COMMENT_SORTING_OPTIONS, {
|
dispatch(openPopover(POPOVER_COMMENT_SORTING_OPTIONS, {
|
||||||
targetRef,
|
targetRef,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user