2021-09-13 20:41:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { Text } from 'react-native';
|
|
|
|
|
|
|
|
import styles from './styles';
|
2022-04-07 14:10:03 +00:00
|
|
|
import { themes } from '../../lib/constants';
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
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;
|