diff --git a/client/coral-admin/src/routes/Community/components/User.js b/client/coral-admin/src/routes/Community/components/User.js index ee917e295..b6a01f016 100644 --- a/client/coral-admin/src/routes/Community/components/User.js +++ b/client/coral-admin/src/routes/Community/components/User.js @@ -2,17 +2,18 @@ import React from 'react'; import styles from './Community.css'; import ActionButton from './ActionButton'; +import {username} from 'coral-plugin-flags/helpers/flagReasons'; import ActionsMenu from 'coral-admin/src/components/ActionsMenu'; import ActionsMenuItem from 'coral-admin/src/components/ActionsMenuItem'; import t from 'coral-framework/services/i18n'; const shortReasons = { - 'This comment is offensive': t('community.offensive'), - 'This looks like an ad/marketing': t('community.spam_ads'), - 'This user is impersonating': t('community.impersonating'), - 'I don\'t like this username': t('community.dont_like_username'), - 'Other': t('community.other') + [username.other]: t('community.other'), + [username.spam]: t('community.spam_ads'), + [username.offensive]: t('community.offensive'), + [username.nolike]: t('community.dont_like_username'), + [username.impersonating]: t('community.impersonating'), }; // Render a single user for the list diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index c3b7095e2..6e3c645be 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -4,7 +4,7 @@ import AuthorName from 'coral-plugin-author-name/AuthorName'; import TagLabel from 'coral-plugin-tag-label/TagLabel'; import PubDate from 'coral-plugin-pubdate/PubDate'; import {ReplyBox, ReplyButton} from 'coral-plugin-replies'; -import FlagComment from 'coral-plugin-flags/FlagComment'; +import {FlagComment} from 'coral-plugin-flags'; import {can} from 'coral-framework/services/perms'; import {TransitionGroup} from 'react-transition-group'; import cn from 'classnames'; diff --git a/client/coral-plugin-flags/FlagButton.js b/client/coral-plugin-flags/components/FlagButton.js similarity index 100% rename from client/coral-plugin-flags/FlagButton.js rename to client/coral-plugin-flags/components/FlagButton.js diff --git a/client/coral-plugin-flags/FlagComment.js b/client/coral-plugin-flags/components/FlagComment.js similarity index 58% rename from client/coral-plugin-flags/FlagComment.js rename to client/coral-plugin-flags/components/FlagComment.js index efc4c282f..fc67d4b71 100644 --- a/client/coral-plugin-flags/FlagComment.js +++ b/client/coral-plugin-flags/components/FlagComment.js @@ -2,6 +2,7 @@ import React from 'react'; import FlagButton from './FlagButton'; import t from 'coral-framework/services/i18n'; +import {username, comment} from '../helpers/flagReasons'; const FlagComment = (props) => ; @@ -20,17 +21,17 @@ const getPopupMenu = [ (itemType) => { const options = itemType === 'COMMENTS' ? [ - {val: 'This comment is offensive', text: t('comment_offensive')}, - {val: 'This looks like an ad/marketing', text: t('marketing')}, - {val: 'I don\'t agree with this comment', text: t('no_agree_comment')}, - {val: 'Other', text: t('other')} + {val: comment.offensive, text: t('comment_offensive')}, + {val: comment.spam, text: t('marketing')}, + {val: comment.noagree, text: t('no_agree_comment')}, + {val: comment.other, text: t('other')} ] : [ - {val: 'This username is offensive', text: t('username_offensive')}, - {val: 'I don\'t like this username', text: t('no_like_username')}, - {val: 'This user is impersonating', text: t('user_impersonating')}, - {val: 'This looks like an ad/marketing', text: t('marketing')}, - {val: 'Other', text: t('other')} + {val: username.offensive, text: t('username_offensive')}, + {val: username.nolike, text: t('no_like_username')}, + {val: username.impersonating, text: t('user_impersonating')}, + {val: username.spam, text: t('marketing')}, + {val: username.other, text: t('other')} ]; return { header: t('step_2_header'), diff --git a/client/coral-plugin-flags/helpers/flagReasons.js b/client/coral-plugin-flags/helpers/flagReasons.js new file mode 100644 index 000000000..514c57398 --- /dev/null +++ b/client/coral-plugin-flags/helpers/flagReasons.js @@ -0,0 +1,15 @@ +export default { + username: { + offensive: 'USERNAME_OFFENSIVE', + nolike: 'USERNAME_NOLIKE', + impersonating: 'USERNAME_IMPERSONATING', + spam: 'USERNAME_SPAM', + other: 'USERNAME_OTHER' + }, + comment: { + offensive: 'COMMENT_OFFENSIVE', + spam: 'COMMENT_SPAM', + noagree: 'COMMENT_NOAGREE', + other: 'COMMENT_OTHER' + } +}; diff --git a/client/coral-plugin-flags/index.js b/client/coral-plugin-flags/index.js new file mode 100644 index 000000000..d896d34f5 --- /dev/null +++ b/client/coral-plugin-flags/index.js @@ -0,0 +1 @@ +export {default as FlagComment} from './components/FlagComment'; \ No newline at end of file