55 lines
1.6 KiB
JavaScript
Executable file
55 lines
1.6 KiB
JavaScript
Executable file
import React from 'react';
|
|
import MediaEngineStore from '../../stores/MediaEngineStore';
|
|
import RTCConnectionStore from '../../stores/RTCConnectionStore';
|
|
import RunningGameStore from '../../stores/RunningGameStore';
|
|
import PermissionActionCreators from '../../actions/PermissionActionCreators';
|
|
import i18n from '../../i18n';
|
|
import HelpdeskUtils from '../../utils/HelpdeskUtils';
|
|
import {InputModes} from '../../Constants';
|
|
import Alert from '../Alert';
|
|
|
|
const HELPDESK_ID = 205082178;
|
|
|
|
const PTTPermission = React.createClass({
|
|
statics: {
|
|
modalConfig: {
|
|
stores: [RunningGameStore, MediaEngineStore],
|
|
|
|
isOpen() {
|
|
return (
|
|
RunningGameStore.getGameRequiresElevation() &&
|
|
RTCConnectionStore.isConnected() &&
|
|
MediaEngineStore.getMode() === InputModes.PUSH_TO_TALK &&
|
|
RunningGameStore.canShowAdminWarning
|
|
);
|
|
},
|
|
|
|
getProps() {
|
|
return {
|
|
gameName: RunningGameStore.getGameName(),
|
|
};
|
|
},
|
|
},
|
|
},
|
|
|
|
render() {
|
|
return (
|
|
<Alert
|
|
title={i18n.Messages.PTT_PERMISSION_TITLE}
|
|
body={i18n.Messages.PTT_PERMISSION_BODY.format({game: this.props.gameName})}
|
|
minorText={i18n.Messages.DONT_SHOW_AGAIN}
|
|
onConfirmSecondary={() => PermissionActionCreators.clearPTTAdminWarning()}
|
|
onConfirm={() => window.open(HelpdeskUtils.getArticleURL(HELPDESK_ID), '_blank')}
|
|
confirmText={i18n.Messages.HELP_DESK}
|
|
iconUrl={require('../../images/no-mic.svg')}
|
|
/>
|
|
);
|
|
},
|
|
});
|
|
|
|
export default PTTPermission;
|
|
|
|
|
|
|
|
// WEBPACK FOOTER //
|
|
// ./discord_app/components/warnings/PTTPermission.js
|