Rocket.Chat.ReactNative/app/presentation/RoomItem/Title.tsx

24 lines
523 B
TypeScript

import React from 'react';
import { Text } from 'react-native';
import styles from './styles';
import { themes } from '../../lib/constants';
interface ITitle {
name: string;
theme: string;
hideUnreadStatus: boolean;
alert: boolean;
}
const Title = React.memo(({ name, theme, hideUnreadStatus, alert }: ITitle) => (
<Text
style={[styles.title, alert && !hideUnreadStatus && styles.alert, { color: themes[theme].titleText }]}
ellipsizeMode='tail'
numberOfLines={1}>
{name}
</Text>
));
export default Title;