[CHORE] Use markdown preview on RoomView Header (#1807)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
005e1ac46b
commit
d1844ba16e
|
@ -3,14 +3,13 @@ import PropTypes from 'prop-types';
|
||||||
import {
|
import {
|
||||||
View, Text, StyleSheet, ScrollView, TouchableOpacity
|
View, Text, StyleSheet, ScrollView, TouchableOpacity
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import removeMarkdown from 'remove-markdown';
|
|
||||||
|
|
||||||
import shortnameToUnicode from '../../../utils/shortnameToUnicode';
|
|
||||||
import I18n from '../../../i18n';
|
import I18n from '../../../i18n';
|
||||||
import sharedStyles from '../../Styles';
|
import sharedStyles from '../../Styles';
|
||||||
import { isAndroid, isTablet } from '../../../utils/deviceInfo';
|
import { isAndroid, isTablet } from '../../../utils/deviceInfo';
|
||||||
import Icon from './Icon';
|
import Icon from './Icon';
|
||||||
import { themes } from '../../../constants/colors';
|
import { themes } from '../../../constants/colors';
|
||||||
|
import Markdown from '../../../containers/markdown';
|
||||||
|
|
||||||
const androidMarginLeft = isTablet ? 0 : 10;
|
const androidMarginLeft = isTablet ? 0 : 10;
|
||||||
|
|
||||||
|
@ -75,12 +74,14 @@ const HeaderTitle = React.memo(({
|
||||||
title = I18n.t('Connecting');
|
title = I18n.t('Connecting');
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Text
|
<Markdown
|
||||||
|
preview
|
||||||
|
msg={title}
|
||||||
style={[styles.title, { fontSize: TITLE_SIZE * scale, color: themes[theme].headerTitleColor }]}
|
style={[styles.title, { fontSize: TITLE_SIZE * scale, color: themes[theme].headerTitleColor }]}
|
||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
testID={`room-view-title-${ title }`}
|
testID={`room-view-title-${ title }`}
|
||||||
>{title}
|
theme={theme}
|
||||||
</Text>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -102,12 +103,6 @@ const Header = React.memo(({
|
||||||
scale = 0.8;
|
scale = 0.8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (title) {
|
|
||||||
title = shortnameToUnicode(title);
|
|
||||||
if (tmid) {
|
|
||||||
title = removeMarkdown(title);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const onPress = () => {
|
const onPress = () => {
|
||||||
if (!tmid) {
|
if (!tmid) {
|
||||||
|
|
Loading…
Reference in New Issue