2019-05-27 16:19:39 +00:00
|
|
|
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
|
2019-05-27 16:19:39 +00:00
|
|
|
}) => {
|
|
|
|
if (editing) {
|
2019-12-04 16:39:53 +00:00
|
|
|
return <CancelEditingButton onPress={editCancel} theme={theme} />;
|
2019-05-27 16:19:39 +00:00
|
|
|
}
|
2019-12-04 16:39:53 +00:00
|
|
|
return <FileButton onPress={showFileActions} theme={theme} />;
|
2019-05-27 16:19:39 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
LeftButtons.propTypes = {
|
2019-12-04 16:39:53 +00:00
|
|
|
theme: PropTypes.string,
|
2019-05-27 16:19:39 +00:00
|
|
|
showFileActions: PropTypes.func.isRequired,
|
|
|
|
editing: PropTypes.bool,
|
|
|
|
editCancel: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
export default LeftButtons;
|