2017-11-09 02:41:15 +08:00
|
|
|
import React, { Component } from 'react';
|
2017-11-18 03:01:52 +08:00
|
|
|
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
|
|
|
|
2017-11-18 03:01:52 +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);
|
|
|
|
|
2017-11-18 03:01:52 +08:00
|
|
|
const broswerStyles = {
|
|
|
|
Chrome: {
|
2017-11-17 19:52:48 +08:00
|
|
|
top: '145px',
|
|
|
|
left: '380px',
|
|
|
|
},
|
2017-11-18 03:01:52 +08:00
|
|
|
Firefox: {
|
2017-11-17 19:52:48 +08:00
|
|
|
top: '210px',
|
2017-11-18 03:01:52 +08:00
|
|
|
left: '605px',
|
2017-11-17 19:52:48 +08:00
|
|
|
},
|
2017-12-14 04:37:31 +08:00
|
|
|
Safari: {
|
|
|
|
top: '100px',
|
|
|
|
left: '100px',
|
|
|
|
},
|
2018-05-12 00:32:56 +08:00
|
|
|
'Microsoft Edge': {
|
2018-06-19 20:28:56 +08:00
|
|
|
top: '38em',
|
2018-06-21 09:56:45 +08:00
|
|
|
left: '60em',
|
2018-05-12 00:32:56 +08:00
|
|
|
},
|
2017-11-18 03:01:52 +08:00
|
|
|
};
|
2017-11-17 19:52:48 +08:00
|
|
|
|
|
|
|
const browser = window.bowser.name;
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
styles: {
|
2017-11-18 03:01:52 +08:00
|
|
|
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() {
|
2017-11-18 03:01:52 +08:00
|
|
|
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}>
|
2017-11-18 03:01:52 +08:00
|
|
|
{ intl.formatMessage(intlMessages.title) }
|
2017-11-09 02:41:15 +08:00
|
|
|
<small>
|
2017-11-18 03:01:52 +08:00
|
|
|
{ intl.formatMessage(intlMessages.hint) }
|
2017-11-09 02:41:15 +08:00
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-11-18 03:01:52 +08:00
|
|
|
);
|
2017-11-09 02:41:15 +08:00
|
|
|
}
|
|
|
|
}
|
2017-11-18 03:01:52 +08:00
|
|
|
|
|
|
|
PermissionsOverlay.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default injectIntl(PermissionsOverlay);
|