import React from 'react'; import PropTypes from 'prop-types'; import { defineMessages, injectIntl, intlShape } from 'react-intl'; import Button from '/imports/ui/components/button/component'; import { withModalMounter } from '/imports/ui/components/modal/service'; import DeviceSelector from '/imports/ui/components/audio/device-selector/component'; import AudioTestContainer from '/imports/ui/components/audio/audio-test/container'; import cx from 'classnames'; import { styles } from './styles'; const propTypes = { intl: intlShape.isRequired, changeInputDevice: PropTypes.func.isRequired, changeOutputDevice: PropTypes.func.isRequired, handleBack: PropTypes.func.isRequired, handleRetry: PropTypes.func.isRequired, isConnecting: PropTypes.bool.isRequired, inputDeviceId: PropTypes.string.isRequired, outputDeviceId: PropTypes.string.isRequired, }; const intlMessages = defineMessages({ backLabel: { id: 'app.audio.backLabel', description: 'audio settings back button label', }, descriptionLabel: { id: 'app.audio.audioSettings.descriptionLabel', description: 'audio settings description label', }, micSourceLabel: { id: 'app.audio.audioSettings.microphoneSourceLabel', description: 'Label for mic source', }, speakerSourceLabel: { id: 'app.audio.audioSettings.speakerSourceLabel', description: 'Label for speaker source', }, streamVolumeLabel: { id: 'app.audio.audioSettings.microphoneStreamLabel', description: 'Label for stream volume', }, retryLabel: { id: 'app.audio.audioSettings.retryLabel', description: 'Retry button label', }, }); class AudioSettings extends React.Component { constructor(props) { super(props); const { inputDeviceId, outputDeviceId, } = props; this.handleInputChange = this.handleInputChange.bind(this); this.handleOutputChange = this.handleOutputChange.bind(this); this.state = { inputDeviceId, outputDeviceId, }; } handleInputChange(deviceId) { const { changeInputDevice, } = this.props; changeInputDevice(deviceId); this.setState({ inputDeviceId: deviceId, }); } handleOutputChange(deviceId) { const { changeOutputDevice, } = this.props; changeOutputDevice(deviceId); this.setState({ outputDeviceId: deviceId, }); } render() { const { isConnecting, intl, handleBack, handleRetry, } = this.props; return (
{intl.formatMessage(intlMessages.descriptionLabel)}
); } } AudioSettings.propTypes = propTypes; export default withModalMounter(injectIntl(AudioSettings));