vn-verdnaturachat/app/containers/MessageBox/RightButtons.js

23 lines
551 B
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { SendButton, AudioButton } from './buttons';
const RightButtons = React.memo(({
2019-12-04 16:39:53 +00:00
theme, showSend, submit, recordAudioMessage
}) => {
if (showSend) {
2019-12-04 16:39:53 +00:00
return <SendButton theme={theme} onPress={submit} />;
}
2019-12-04 16:39:53 +00:00
return <AudioButton theme={theme} onPress={recordAudioMessage} />;
});
RightButtons.propTypes = {
2019-12-04 16:39:53 +00:00
theme: PropTypes.string,
showSend: PropTypes.bool,
submit: PropTypes.func.isRequired,
recordAudioMessage: PropTypes.func.isRequired
};
export default RightButtons;