display reposts information #127

Merged
akinwale merged 1 commit from reposts-display into master 2020-03-02 18:03:58 +01:00
3 changed files with 42 additions and 9 deletions

View file

@ -99,9 +99,12 @@ class FileListItem extends React.PureComponent {
isRewardContent,
channelClaimId,
fullChannelUri,
repostChannel,
repostChannelUrl,
shortChannelUri,
shouldHide,
signingChannel;
signingChannel,
isRepost;
if (claim) {
name = claim.name;
signingChannel = claim.signing_channel;
@ -111,6 +114,12 @@ class FileListItem extends React.PureComponent {
channelClaimId = signingChannel ? signingChannel.claim_id : null;
fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel;
shortChannelUri = signingChannel ? signingChannel.short_url : null;
repostChannelUrl = claim.repost_channel_url;
if (repostChannelUrl) {
const { claimName: repostChannelName } = parseURI(repostChannelUrl);
repostChannel = repostChannelName;
}
isRepost = !!repostChannelUrl;
if (blackListedOutpoints || filteredOutpoints) {
const outpointsToHide = !blackListedOutpoints
@ -127,11 +136,20 @@ class FileListItem extends React.PureComponent {
return null;
}
const actualHideChannel = !isRepost && hideChannel;
const isChannel = name && name.startsWith('@');
const hasThumbnail = !!thumbnail;
return (
<View style={style}>
<View>
{isRepost && (
<View style={fileListStyle.repostInfo}>
<Icon name={"retweet"} size={14} style={fileListStyle.repostIcon} />
<Text style={fileListStyle.repostChannelName}>
<Link text={repostChannel}
onPress={() => navigateToUri(navigation, normalizeURI(repostChannelUrl), null, false, null, false)} /> reposted</Text>
</View>
)}
<TouchableOpacity
style={[style, isChannel ? fileListStyle.channelContainer : null]}
onPress={this.onPressHandler}
@ -212,7 +230,7 @@ class FileListItem extends React.PureComponent {
<View style={fileListStyle.titleContainer}>
<Text
style={featuredResult ? fileListStyle.featuredTitle : fileListStyle.title}
numberOfLines={hideChannel ? 4 : 3}
numberOfLines={actualHideChannel ? 4 : 3}
>
{title || name}
</Text>
@ -226,7 +244,7 @@ class FileListItem extends React.PureComponent {
</View>
)}
{(channel || isChannel) && !hideChannel && (
{(channel || isChannel) && !actualHideChannel && (
<Link
style={fileListStyle.publisher}
text={isChannel ? name : channel}

View file

@ -25,10 +25,10 @@ const claimListStyle = StyleSheet.create({
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between',
marginLeft: 8,
marginRight: 8,
marginTop: 4,
marginBottom: 4,
marginLeft: 16,
marginRight: 16,
marginTop: 8,
marginBottom: 12,
},
verticalLoading: {
width: '100%',

View file

@ -165,6 +165,21 @@ const fileListStyle = StyleSheet.create({
marginRight: 2,
color: '#0c604b',
},
repostChannelName: {
color: Colors.DescriptionGrey,
fontFamily: 'Inter-Regular',
fontSize: 14,
},
repostIcon: {
color: Colors.DescriptionGrey,
marginRight: 4,
},
repostInfo: {
marginLeft: 16,
marginRight: 16,
alignItems: 'center',
flexDirection: 'row',
},
});
export default fileListStyle;