2021-09-13 20:41:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
|
|
|
|
import { ActionsButton, CancelEditingButton } from './buttons';
|
|
|
|
import styles from './styles';
|
|
|
|
|
|
|
|
interface IMessageBoxLeftButtons {
|
|
|
|
showMessageBoxActions(): void;
|
|
|
|
editing: boolean;
|
|
|
|
editCancel(): void;
|
|
|
|
isActionsEnabled: boolean;
|
|
|
|
}
|
|
|
|
|
2022-03-31 22:39:24 +00:00
|
|
|
const LeftButtons = React.memo(({ showMessageBoxActions, editing, editCancel, isActionsEnabled }: IMessageBoxLeftButtons) => {
|
|
|
|
if (editing) {
|
|
|
|
return <CancelEditingButton onPress={editCancel} />;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
2022-03-31 22:39:24 +00:00
|
|
|
if (isActionsEnabled) {
|
|
|
|
return <ActionsButton onPress={showMessageBoxActions} />;
|
|
|
|
}
|
|
|
|
return <View style={styles.buttonsWhitespace} />;
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
export default LeftButtons;
|