mirror of
https://github.com/wassname/talk.git
synced 2026-09-11 12:51:33 +08:00
Adds ban/unban to cli. Fix ban user in the admin.
This commit is contained in:
@@ -9,9 +9,14 @@ import I18n from 'coral-framework/modules/i18n/i18n';
|
||||
import translations from '../translations';
|
||||
const lang = new I18n(translations);
|
||||
|
||||
const BanUserDialog = ({open, handleClose, authorName}) => (
|
||||
<Dialog className={styles.dialog} open={open} title={lang.t('bandialog.ban_user')} onClose={handleClose} onCancel={handleClose}>
|
||||
<span className={styles.close} onClick={handleClose}>×</span>
|
||||
const BanUserDialog = ({open, handleClose, onClickBanUser, user}) => {
|
||||
const userName = (typeof user === 'undefined') ? '' : user['userName'];
|
||||
const userId = (typeof user === 'undefined') ? '' : user['userId'];
|
||||
const commentId = (typeof user === 'undefined') ? '' : user['commentId'];
|
||||
|
||||
return (
|
||||
<Dialog className={styles.dialog} open={open} onClose={() => handleClose()} onCancel={() => handleClose()} title={lang.t('bandialog.ban_user')}>
|
||||
<span className={styles.close} onClick={() => handleClose()}>×</span>
|
||||
<div>
|
||||
<div className={styles.header}>
|
||||
<h3>
|
||||
@@ -20,21 +25,23 @@ const BanUserDialog = ({open, handleClose, authorName}) => (
|
||||
</div>
|
||||
<div className={styles.separator}>
|
||||
<h4>
|
||||
{lang.t('bandialog.are_you_sure', authorName)}
|
||||
{lang.t('bandialog.are_you_sure', userName)}
|
||||
</h4>
|
||||
<i>
|
||||
{lang.t('bandialog.note')}
|
||||
</i>
|
||||
</div>
|
||||
<div className={styles.buttons}>
|
||||
<Button cStyle="cancel" full>
|
||||
<Button cStyle="cancel" onClick={() => handleClose()} full>
|
||||
{lang.t('bandialog.cancel')}
|
||||
</Button>
|
||||
<Button cStyle="black" full>
|
||||
<Button cStyle="black" onClick={() => onClickBanUser(userId, commentId)} full>
|
||||
{lang.t('bandialog.yes_ban_user')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Dialog>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
export default BanUserDialog;
|
||||
|
||||
Reference in New Issue
Block a user