2021-09-13 20:41:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { Text } from 'react-native';
|
|
|
|
|
|
|
|
import styles from './styles';
|
2022-04-20 21:37:54 +00:00
|
|
|
import { ITitleProps } from './interfaces';
|
2022-06-27 18:23:43 +00:00
|
|
|
import { useTheme } from '../../theme';
|
2021-09-13 20:41:05 +00:00
|
|
|
|
2022-06-27 18:23:43 +00:00
|
|
|
const Title = React.memo(({ name, hideUnreadStatus, alert }: ITitleProps) => {
|
|
|
|
const { colors } = useTheme();
|
|
|
|
return (
|
|
|
|
<Text
|
|
|
|
style={[styles.title, alert && !hideUnreadStatus && styles.alert, { color: colors.titleText }]}
|
|
|
|
ellipsizeMode='tail'
|
|
|
|
numberOfLines={1}>
|
|
|
|
{name}
|
|
|
|
</Text>
|
|
|
|
);
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
export default Title;
|