remove unused theme prop
This commit is contained in:
parent
cc52d50ea8
commit
adde82889a
|
@ -3,7 +3,6 @@ import React from 'react';
|
||||||
import { CancelEditingButton, ToggleEmojiButton } from './buttons';
|
import { CancelEditingButton, ToggleEmojiButton } from './buttons';
|
||||||
|
|
||||||
interface IMessageBoxLeftButtons {
|
interface IMessageBoxLeftButtons {
|
||||||
theme: string;
|
|
||||||
showEmojiKeyboard: boolean;
|
showEmojiKeyboard: boolean;
|
||||||
openEmoji(): void;
|
openEmoji(): void;
|
||||||
closeEmoji(): void;
|
closeEmoji(): void;
|
||||||
|
@ -11,13 +10,11 @@ interface IMessageBoxLeftButtons {
|
||||||
editCancel(): void;
|
editCancel(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LeftButtons = React.memo(
|
const LeftButtons = ({ showEmojiKeyboard, editing, editCancel, openEmoji, closeEmoji }: IMessageBoxLeftButtons) => {
|
||||||
({ theme, showEmojiKeyboard, editing, editCancel, openEmoji, closeEmoji }: IMessageBoxLeftButtons) => {
|
if (editing) {
|
||||||
if (editing) {
|
return <CancelEditingButton onPress={editCancel} />;
|
||||||
return <CancelEditingButton onPress={editCancel} theme={theme} />;
|
|
||||||
}
|
|
||||||
return <ToggleEmojiButton show={showEmojiKeyboard} open={openEmoji} close={closeEmoji} theme={theme} />;
|
|
||||||
}
|
}
|
||||||
);
|
return <ToggleEmojiButton show={showEmojiKeyboard} open={openEmoji} close={closeEmoji} />;
|
||||||
|
};
|
||||||
|
|
||||||
export default LeftButtons;
|
export default LeftButtons;
|
||||||
|
|
|
@ -5,23 +5,20 @@ import { ActionsButton, CancelEditingButton } from './buttons';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
|
|
||||||
interface IMessageBoxLeftButtons {
|
interface IMessageBoxLeftButtons {
|
||||||
theme: string;
|
|
||||||
showMessageBoxActions(): void;
|
showMessageBoxActions(): void;
|
||||||
editing: boolean;
|
editing: boolean;
|
||||||
editCancel(): void;
|
editCancel(): void;
|
||||||
isActionsEnabled: boolean;
|
isActionsEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LeftButtons = React.memo(
|
const LeftButtons = ({ showMessageBoxActions, editing, editCancel, isActionsEnabled }: IMessageBoxLeftButtons) => {
|
||||||
({ theme, showMessageBoxActions, editing, editCancel, isActionsEnabled }: IMessageBoxLeftButtons) => {
|
if (editing) {
|
||||||
if (editing) {
|
return <CancelEditingButton onPress={editCancel} />;
|
||||||
return <CancelEditingButton onPress={editCancel} theme={theme} />;
|
|
||||||
}
|
|
||||||
if (isActionsEnabled) {
|
|
||||||
return <ActionsButton onPress={showMessageBoxActions} theme={theme} />;
|
|
||||||
}
|
|
||||||
return <View style={styles.buttonsWhitespace} />;
|
|
||||||
}
|
}
|
||||||
);
|
if (isActionsEnabled) {
|
||||||
|
return <ActionsButton onPress={showMessageBoxActions} />;
|
||||||
|
}
|
||||||
|
return <View style={styles.buttonsWhitespace} />;
|
||||||
|
};
|
||||||
|
|
||||||
export default LeftButtons;
|
export default LeftButtons;
|
||||||
|
|
|
@ -12,17 +12,15 @@ interface IMessageBoxRightButtons {
|
||||||
isActionsEnabled: boolean;
|
isActionsEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const RightButtons = React.memo(
|
const RightButtons = ({ showSend, submit, showMessageBoxActions, isActionsEnabled }: IMessageBoxRightButtons) => {
|
||||||
({ theme, showSend, submit, showMessageBoxActions, isActionsEnabled }: IMessageBoxRightButtons) => {
|
if (showSend) {
|
||||||
if (showSend) {
|
return <SendButton onPress={submit} />;
|
||||||
return <SendButton onPress={submit} theme={theme} />;
|
|
||||||
}
|
|
||||||
if (isActionsEnabled) {
|
|
||||||
return <ActionsButton onPress={showMessageBoxActions} theme={theme} />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return <View style={styles.buttonsWhitespace} />;
|
|
||||||
}
|
}
|
||||||
);
|
if (isActionsEnabled) {
|
||||||
|
return <ActionsButton onPress={showMessageBoxActions} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <View style={styles.buttonsWhitespace} />;
|
||||||
|
};
|
||||||
|
|
||||||
export default RightButtons;
|
export default RightButtons;
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { useColors } from '@app/lib/hooks/useColors';
|
||||||
import BaseButton from './BaseButton';
|
import BaseButton from './BaseButton';
|
||||||
|
|
||||||
interface ISendButton {
|
interface ISendButton {
|
||||||
theme: string;
|
|
||||||
onPress(): void;
|
onPress(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue