57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
|
import React from 'react';
|
||
|
import PermissionSpeakStore from '../../stores/PermissionSpeakStore';
|
||
|
import PermissionActionCreators from '../../actions/PermissionActionCreators';
|
||
|
import i18n from '../../i18n';
|
||
|
import Alert from '../Alert';
|
||
|
|
||
|
const Suppressed = React.createClass({
|
||
|
statics: {
|
||
|
modalConfig: {
|
||
|
store: PermissionSpeakStore,
|
||
|
|
||
|
isOpen() {
|
||
|
return PermissionSpeakStore.shouldShowWarning();
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
|
||
|
close() {
|
||
|
PermissionActionCreators.clearSuppressWarning();
|
||
|
},
|
||
|
|
||
|
handleCloseForever() {
|
||
|
PermissionActionCreators.clearSuppressWarning(true);
|
||
|
},
|
||
|
|
||
|
render() {
|
||
|
const afk = PermissionSpeakStore.isAFKChannel();
|
||
|
let title;
|
||
|
let body;
|
||
|
if (afk) {
|
||
|
title = i18n.Messages.SUPPRESSED_AFK_TITLE;
|
||
|
body = i18n.Messages.SUPPRESSED_AFK_BODY;
|
||
|
} else {
|
||
|
title = i18n.Messages.SUPPRESSED;
|
||
|
body = i18n.Messages.SUPPRESSED_PERMISSION_BODY;
|
||
|
}
|
||
|
|
||
|
return (
|
||
|
<Alert
|
||
|
title={title}
|
||
|
body={body}
|
||
|
onConfirm={this.close}
|
||
|
confirmText={i18n.Messages.OKAY}
|
||
|
minorText={i18n.Messages.DONT_SHOW_AGAIN}
|
||
|
onConfirmSecondary={this.handleCloseForever}
|
||
|
iconUrl={require('../../images/idle.svg')}
|
||
|
/>
|
||
|
);
|
||
|
},
|
||
|
});
|
||
|
|
||
|
export default Suppressed;
|
||
|
|
||
|
|
||
|
|
||
|
// WEBPACK FOOTER //
|
||
|
// ./discord_app/components/warnings/Suppressed.js
|