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 styles from '../../styles';
import { useTheme } from '../../../../theme'; 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(); const { theme } = useTheme();
if (isReadReceiptEnabled && !unread && unread !== null) { if (isReadReceiptEnabled && !unread && unread !== null) {
return <CustomIcon name='check' color={themes[theme].tintColor} size={16} style={styles.rightIcons} />; return <CustomIcon name='check' color={themes[theme].tintColor} size={16} style={styles.rightIcons} />;

View File

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

View File

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

View File

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