2020-02-17 12:14:56 +00:00
|
|
|
import React from 'react';
|
2020-06-26 20:22:56 +00:00
|
|
|
import { View } from 'react-native';
|
2020-02-17 12:14:56 +00:00
|
|
|
|
2020-07-06 19:23:46 +00:00
|
|
|
import { SendButton, ActionsButton } from './buttons';
|
2020-06-26 20:22:56 +00:00
|
|
|
import styles from './styles';
|
2020-02-17 12:14:56 +00:00
|
|
|
|
2021-07-23 04:15:16 +00:00
|
|
|
interface IMessageBoxRightButtons {
|
|
|
|
theme: string;
|
|
|
|
showSend: boolean;
|
|
|
|
submit(): void;
|
|
|
|
showMessageBoxActions(): void;
|
|
|
|
isActionsEnabled: boolean;
|
|
|
|
}
|
|
|
|
|
2020-02-17 12:14:56 +00:00
|
|
|
const RightButtons = React.memo(({
|
2020-07-06 19:23:46 +00:00
|
|
|
theme, showSend, submit, showMessageBoxActions, isActionsEnabled
|
2021-07-23 04:15:16 +00:00
|
|
|
}: IMessageBoxRightButtons) => {
|
2020-02-17 12:14:56 +00:00
|
|
|
if (showSend) {
|
|
|
|
return <SendButton onPress={submit} theme={theme} />;
|
|
|
|
}
|
2020-07-06 19:23:46 +00:00
|
|
|
if (isActionsEnabled) {
|
|
|
|
return <ActionsButton onPress={showMessageBoxActions} theme={theme} />;
|
2020-02-20 21:02:09 +00:00
|
|
|
}
|
2020-07-06 19:23:46 +00:00
|
|
|
|
2020-06-26 20:22:56 +00:00
|
|
|
return <View style={styles.buttonsWhitespace} />;
|
2020-02-17 12:14:56 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
export default RightButtons;
|