remove wrong logic on badge prop (#4564)

Co-authored-by: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com>
This commit is contained in:
Gleidson Daniel Silva 2022-10-18 15:25:15 -03:00 committed by Diego Mello
parent 7442f2c844
commit 2629140159
4 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ import { CustomIcon } from '../../../CustomIcon';
import styles from '../../styles';
import { useTheme } from '../../../../theme';
const ReadReceipt = React.memo(({ isReadReceiptEnabled, unread }: { isReadReceiptEnabled?: boolean; unread: boolean }) => {
const ReadReceipt = React.memo(({ isReadReceiptEnabled, unread }: { isReadReceiptEnabled?: boolean; unread?: boolean }) => {
const { theme } = useTheme();
if (isReadReceiptEnabled && !unread && unread !== null) {
return <CustomIcon name='check' color={themes[theme].tintColor} size={16} style={styles.rightIcons} />;

View File

@ -17,8 +17,8 @@ interface IRightIcons {
type: MessageType;
msg?: string;
isEdited: boolean;
isReadReceiptEnabled: boolean;
unread: boolean;
isReadReceiptEnabled?: boolean;
unread?: boolean;
hasError: boolean;
}
@ -27,7 +27,7 @@ const RightIcons = ({ type, msg, isEdited, hasError, isReadReceiptEnabled, unrea
<Encrypted type={type} />
<Edited testID={`${msg}-edited`} isEdited={isEdited} />
<MessageError hasError={hasError} />
<ReadReceipt isReadReceiptEnabled={isReadReceiptEnabled} unread={unread || false} />
<ReadReceipt isReadReceiptEnabled={isReadReceiptEnabled} unread={unread} />
</View>
);

View File

@ -97,8 +97,8 @@ const Message = React.memo((props: IMessage) => {
msg={props.msg}
isEdited={props.isEdited}
hasError={props.hasError}
isReadReceiptEnabled={props.isReadReceiptEnabled || false}
unread={props.unread || false}
isReadReceiptEnabled={props.isReadReceiptEnabled}
unread={props.unread}
/>
) : null}
</View>

View File

@ -114,8 +114,8 @@ const User = React.memo(
type={type}
isEdited={isEdited}
hasError={hasError}
isReadReceiptEnabled={props.isReadReceiptEnabled || false}
unread={props.unread || false}
isReadReceiptEnabled={props.isReadReceiptEnabled}
unread={props.unread}
/>
</View>
);