[IMPROVEMENT] Make links clickable on Room Info (#1730)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Prateek Jain 2020-02-21 01:53:09 +05:30 committed by GitHub
parent 5f8108d8ff
commit bfc4e8d127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -21,6 +21,7 @@ import { themes } from '../../constants/colors';
import { withTheme } from '../../theme';
import { themedHeader } from '../../utils/navigation';
import { getUserSelector } from '../../selectors/login';
import Markdown from '../../containers/markdown';
const PERMISSION_EDIT_ROOM = 'edit-room';
const camelize = str => str.replace(/^(.)/, (match, chr) => chr.toUpperCase());
@ -172,12 +173,12 @@ class RoomInfoView extends React.Component {
const { theme } = this.props;
return (
<View style={styles.item}>
<Text style={[styles.itemLabel, { color: themes[theme].titleText }]}>{I18n.t(camelize(key))}</Text>
<Text
style={[styles.itemContent, !room[key] && styles.itemContent__empty, { color: themes[theme].auxiliaryText }]}
testID={`room-info-view-${ key }`}
>{ room[key] ? room[key] : I18n.t(`No_${ key }_provided`) }
</Text>
<Text style={[styles.itemLabel, { color: themes[theme].auxiliaryText }]}>{I18n.t(camelize(key))}</Text>
<Markdown
useMarkdown
msg={room[key] ? room[key] : `__${ I18n.t(`No_${ key }_provided`) }__`}
theme={theme}
/>
</View>
);
}