2019-05-27 16:19:39 +00:00
|
|
|
import React from 'react';
|
2020-06-26 20:22:56 +00:00
|
|
|
import { View } from 'react-native';
|
2019-05-27 16:19:39 +00:00
|
|
|
|
2020-03-30 19:50:27 +00:00
|
|
|
import { CancelEditingButton, ActionsButton } from './buttons';
|
2020-06-26 20:22:56 +00:00
|
|
|
import styles from './styles';
|
2019-05-27 16:19:39 +00:00
|
|
|
|
2021-07-23 04:15:16 +00:00
|
|
|
interface IMessageBoxLeftButtons {
|
|
|
|
theme: string;
|
|
|
|
showMessageBoxActions(): void;
|
|
|
|
editing: boolean;
|
|
|
|
editCancel(): void;
|
|
|
|
isActionsEnabled: boolean;
|
|
|
|
}
|
|
|
|
|
2019-05-27 16:19:39 +00:00
|
|
|
const LeftButtons = React.memo(({
|
2020-06-26 20:22:56 +00:00
|
|
|
theme, showMessageBoxActions, editing, editCancel, isActionsEnabled
|
2021-07-23 04:15:16 +00:00
|
|
|
}: IMessageBoxLeftButtons) => {
|
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
|
|
|
}
|
2020-06-26 20:22:56 +00:00
|
|
|
if (isActionsEnabled) {
|
|
|
|
return <ActionsButton onPress={showMessageBoxActions} theme={theme} />;
|
|
|
|
}
|
|
|
|
return <View style={styles.buttonsWhitespace} />;
|
2019-05-27 16:19:39 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
export default LeftButtons;
|