2017-10-04 04:42:10 +08:00
|
|
|
import React, { Component } from 'react';
|
2017-10-12 05:04:10 +08:00
|
|
|
import PropTypes from 'prop-types';
|
2017-10-04 04:42:10 +08:00
|
|
|
import Button from '/imports/ui/components/button/component';
|
2017-10-12 05:04:10 +08:00
|
|
|
import { defineMessages, intlShape, injectIntl } from 'react-intl';
|
2018-01-08 14:17:18 +08:00
|
|
|
import { styles } from './styles';
|
2017-10-04 04:42:10 +08:00
|
|
|
|
|
|
|
const intlMessages = defineMessages({
|
|
|
|
yes: {
|
|
|
|
id: 'app.audioModal.yes',
|
|
|
|
description: 'Hear yourself yes',
|
|
|
|
},
|
|
|
|
no: {
|
|
|
|
id: 'app.audioModal.no',
|
|
|
|
description: 'Hear yourself no',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2017-10-12 05:04:10 +08:00
|
|
|
const propTypes = {
|
|
|
|
handleYes: PropTypes.func.isRequired,
|
|
|
|
handleNo: PropTypes.func.isRequired,
|
|
|
|
intl: intlShape.isRequired,
|
|
|
|
};
|
|
|
|
|
2017-10-04 04:42:10 +08:00
|
|
|
class EchoTest extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
2017-10-05 04:49:11 +08:00
|
|
|
this.handleYes = props.handleYes.bind(this);
|
|
|
|
this.handleNo = props.handleNo.bind(this);
|
2017-10-04 04:42:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
intl,
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
return (
|
2017-11-17 19:52:48 +08:00
|
|
|
<span className={styles.echoTest}>
|
2017-10-04 04:42:10 +08:00
|
|
|
<Button
|
2017-10-05 04:49:11 +08:00
|
|
|
className={styles.button}
|
2017-10-12 05:04:10 +08:00
|
|
|
label={intl.formatMessage(intlMessages.yes)}
|
|
|
|
icon={'thumbs_up'}
|
2017-10-04 04:42:10 +08:00
|
|
|
circle
|
2017-10-12 05:04:10 +08:00
|
|
|
color={'success'}
|
2017-10-04 04:42:10 +08:00
|
|
|
size={'jumbo'}
|
2017-10-12 05:04:10 +08:00
|
|
|
onClick={this.handleYes}
|
2017-10-04 04:42:10 +08:00
|
|
|
/>
|
|
|
|
<Button
|
2017-10-05 04:49:11 +08:00
|
|
|
className={styles.button}
|
2017-10-12 05:04:10 +08:00
|
|
|
label={intl.formatMessage(intlMessages.no)}
|
|
|
|
icon={'thumbs_down'}
|
2017-10-04 04:42:10 +08:00
|
|
|
circle
|
2017-10-12 05:04:10 +08:00
|
|
|
color={'danger'}
|
2017-10-04 04:42:10 +08:00
|
|
|
size={'jumbo'}
|
2017-10-12 05:04:10 +08:00
|
|
|
onClick={this.handleNo}
|
2017-10-04 04:42:10 +08:00
|
|
|
/>
|
2017-10-05 04:49:11 +08:00
|
|
|
</span>
|
2017-10-04 04:42:10 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default injectIntl(EchoTest);
|
2017-10-12 05:04:10 +08:00
|
|
|
|
|
|
|
EchoTest.propTypes = propTypes;
|