mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-15 16:42:10 +03:00
add report button
This commit is contained in:
parent
213b8e440d
commit
7cba799e8b
@ -8,7 +8,7 @@ import get from 'lodash/get';
|
||||
|
||||
// Services and Actions
|
||||
import { reblog } from '../../../providers/steem/dsteem';
|
||||
import { addBookmark } from '../../../providers/esteem/esteem';
|
||||
import { addBookmark, addReport } from '../../../providers/esteem/esteem';
|
||||
import { toastNotification, setRcOffer } from '../../../redux/actions/uiAction';
|
||||
import { openPinCodeModal } from '../../../redux/actions/applicationActions';
|
||||
|
||||
@ -102,6 +102,10 @@ class PostDropdownContainer extends PureComponent {
|
||||
this._redirectToPromote(ROUTES.SCREENS.REDEEM, 2, 'boost');
|
||||
break;
|
||||
|
||||
case 'report':
|
||||
this._report(get(content, 'url'));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -116,6 +120,30 @@ class PostDropdownContainer extends PureComponent {
|
||||
});
|
||||
};
|
||||
|
||||
_report = (url) => {
|
||||
const { dispatch, intl } = this.props;
|
||||
|
||||
addReport(url)
|
||||
.then(() => {
|
||||
dispatch(
|
||||
toastNotification(
|
||||
intl.formatMessage({
|
||||
id: 'report.added',
|
||||
}),
|
||||
),
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
dispatch(
|
||||
toastNotification(
|
||||
intl.formatMessage({
|
||||
id: 'report.added',
|
||||
}),
|
||||
),
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
_addToBookmarks = () => {
|
||||
const { content, currentAccount, dispatch, intl } = this.props;
|
||||
|
||||
|
@ -373,6 +373,9 @@
|
||||
"added": "Added to bookmarks",
|
||||
"add": "Add to bookmarks"
|
||||
},
|
||||
"report": {
|
||||
"added": "Reported objectionable content"
|
||||
},
|
||||
"favorites": {
|
||||
"title": "Favorites",
|
||||
"load_error": "Could not load favorites",
|
||||
@ -403,7 +406,8 @@
|
||||
"share": "share",
|
||||
"bookmarks": "add to bookmarks",
|
||||
"promote": "promote",
|
||||
"boost": "boost"
|
||||
"boost": "boost",
|
||||
"report": "report"
|
||||
},
|
||||
"deep_link": {
|
||||
"no_existing_user": "No existing user",
|
||||
|
@ -1 +1 @@
|
||||
export default ['copy', 'reblog', 'reply', 'share', 'bookmarks', 'promote', 'boost'];
|
||||
export default ['copy', 'reply', 'reblog', 'share', 'bookmarks', 'promote', 'boost', 'report'];
|
||||
|
@ -115,6 +115,13 @@ export const addBookmark = (username, author, permlink) =>
|
||||
})
|
||||
.then((resp) => resp.data);
|
||||
|
||||
export const addReport = (url) =>
|
||||
api
|
||||
.post('/report', {
|
||||
url,
|
||||
})
|
||||
.then((resp) => resp.data);
|
||||
|
||||
/**
|
||||
* @params current username
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user