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