Files
talk/client/coral-plugin-flags/components/FlagComment.js
T
Belen Curcio e03e15fb3b renaming
2017-06-27 16:20:08 -03:00

53 lines
1.4 KiB
JavaScript

import React from 'react';
import FlagButton from './FlagButton';
import t from 'coral-framework/services/i18n';
import {username, comment} from '../helpers/flagReasons';
const FlagComment = (props) => <FlagButton {...props} getPopupMenu={getPopupMenu} />;
const getPopupMenu = [
() => {
return {
header: t('step_1_header'),
options: [
{val: 'COMMENTS', text: t('flag_comment')},
{val: 'USERS', text: t('flag_username')}
],
button: t('continue'),
sets: 'itemType'
};
},
(itemType) => {
const options = itemType === 'COMMENTS' ?
[
{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: 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'),
options,
button: t('continue'),
sets: 'reason'
};
},
() => {
return {
header: t('step_3_header'),
text: t('thank_you'),
button: t('done'),
};
}
];
export default FlagComment;