bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/permissions-overlay/component.jsx

74 lines
1.5 KiB
React
Raw Normal View History

2017-11-09 02:41:15 +08:00
import React, { Component } from 'react';
import { injectIntl, intlShape, defineMessages } from 'react-intl';
2018-01-08 14:17:18 +08:00
import { styles } from './styles';
2017-11-09 02:41:15 +08:00
const propTypes = {
intl: intlShape.isRequired,
};
const intlMessages = defineMessages({
title: {
id: 'app.audio.permissionsOverlay.title',
description: 'Title for the overlay',
},
hint: {
id: 'app.audio.permissionsOverlay.hint',
description: 'Hint for the overlay',
},
});
class PermissionsOverlay extends Component {
2017-11-17 19:52:48 +08:00
constructor(props) {
super(props);
const broswerStyles = {
Chrome: {
2017-11-17 19:52:48 +08:00
top: '145px',
left: '380px',
},
Firefox: {
2017-11-17 19:52:48 +08:00
top: '210px',
left: '605px',
2017-11-17 19:52:48 +08:00
},
Safari: {
top: '100px',
left: '100px',
},
'Microsoft Edge': {
top: '38em',
left: '60em',
},
};
2017-11-17 19:52:48 +08:00
const browser = window.bowser.name;
this.state = {
styles: {
top: broswerStyles[browser].top,
left: broswerStyles[browser].left,
},
};
2017-11-17 19:52:48 +08:00
}
2017-11-09 02:41:15 +08:00
render() {
const {
intl,
} = this.props;
2017-11-09 02:41:15 +08:00
return (
<div className={styles.overlay}>
2017-11-17 19:52:48 +08:00
<div style={this.state.styles} className={styles.hint}>
{ intl.formatMessage(intlMessages.title) }
2017-11-09 02:41:15 +08:00
<small>
{ intl.formatMessage(intlMessages.hint) }
2017-11-09 02:41:15 +08:00
</small>
</div>
</div>
);
2017-11-09 02:41:15 +08:00
}
}
PermissionsOverlay.propTypes = propTypes;
export default injectIntl(PermissionsOverlay);