truncate long channel names on file page

This commit is contained in:
Akinwale Ariwodola 2019-01-30 19:39:23 +01:00
parent 2da930cd41
commit e3bb5d0fb5
3 changed files with 18 additions and 7 deletions

View file

@ -35,6 +35,8 @@ export default class Link extends React.PureComponent {
render() {
const {
ellipsizeMode,
numberOfLines,
onPress,
style,
text
@ -54,7 +56,13 @@ export default class Link extends React.PureComponent {
}
return (
<Text style={styles} onPress={onPress ? onPress : this.handlePress}>{text}</Text>
<Text
style={styles}
numberOfLines={numberOfLines}
ellipsizeMode={ellipsizeMode}
onPress={onPress ? onPress : this.handlePress}>
{text}
</Text>
);
}
};

View file

@ -568,12 +568,14 @@ class FilePage extends React.PureComponent {
{channelName &&
<View style={filePageStyle.channelRow}>
<Link style={filePageStyle.channelName}
selectable={true}
text={channelName}
onPress={() => {
const channelUri = normalizeURI(channelName);
navigateToUri(navigation, channelUri);
}} />
selectable={true}
text={channelName}
numberOfLines={1}
ellipsizeMode={"tail"}
onPress={() => {
const channelUri = normalizeURI(channelName);
navigateToUri(navigation, channelUri);
}} />
<View style={filePageStyle.subscriptionRow}>
<SubscribeButton
style={filePageStyle.actionButton}

View file

@ -74,6 +74,7 @@ const filePageStyle = StyleSheet.create({
fontFamily: 'Inter-UI-SemiBold',
fontSize: 20,
marginTop: 6,
width: '49%',
color: Colors.LbryGreen
},
description: {