Rocket.Chat.ReactNative/app/containers/MessageBox/LeftButtons.ios.js

23 lines
564 B
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { CancelEditingButton, FileButton } from './buttons';
const LeftButtons = React.memo(({
2019-12-04 16:39:53 +00:00
theme, showFileActions, editing, editCancel
}) => {
if (editing) {
2019-12-04 16:39:53 +00:00
return <CancelEditingButton onPress={editCancel} theme={theme} />;
}
2019-12-04 16:39:53 +00:00
return <FileButton onPress={showFileActions} theme={theme} />;
});
LeftButtons.propTypes = {
2019-12-04 16:39:53 +00:00
theme: PropTypes.string,
showFileActions: PropTypes.func.isRequired,
editing: PropTypes.bool,
editCancel: PropTypes.func.isRequired
};
export default LeftButtons;