display reposts properly on publishes page

This commit is contained in:
Akinwale Ariwodola 2020-03-20 10:49:49 +01:00
parent 1df7e617eb
commit 24b264bde3
2 changed files with 24 additions and 11 deletions

View file

@ -99,6 +99,7 @@ class FileListItem extends React.PureComponent {
isRewardContent, isRewardContent,
channelClaimId, channelClaimId,
fullChannelUri, fullChannelUri,
repostUrl,
repostChannel, repostChannel,
repostChannelUrl, repostChannelUrl,
shortChannelUri, shortChannelUri,
@ -114,12 +115,13 @@ class FileListItem extends React.PureComponent {
channelClaimId = signingChannel ? signingChannel.claim_id : null; channelClaimId = signingChannel ? signingChannel.claim_id : null;
fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel; fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel;
shortChannelUri = signingChannel ? signingChannel.short_url : null; shortChannelUri = signingChannel ? signingChannel.short_url : null;
repostUrl = claim.repost_url;
repostChannelUrl = claim.repost_channel_url; repostChannelUrl = claim.repost_channel_url;
if (repostChannelUrl) { if (repostUrl) {
const { claimName: repostChannelName } = parseURI(repostChannelUrl); const { claimName: repostName, channelName } = parseURI(repostUrl);
repostChannel = repostChannelName; repostChannel = channelName;
} }
isRepost = !!repostChannelUrl; isRepost = !!repostUrl;
if (blackListedOutpoints || filteredOutpoints) { if (blackListedOutpoints || filteredOutpoints) {
const outpointsToHide = !blackListedOutpoints const outpointsToHide = !blackListedOutpoints
@ -148,8 +150,17 @@ class FileListItem extends React.PureComponent {
<Icon name={'retweet'} size={14} style={fileListStyle.repostIcon} /> <Icon name={'retweet'} size={14} style={fileListStyle.repostIcon} />
<Text style={fileListStyle.repostChannelName}> <Text style={fileListStyle.repostChannelName}>
<Link <Link
text={repostChannel} text={`@${repostChannel}`}
onPress={() => navigateToUri(navigation, normalizeURI(repostChannelUrl), null, false, null, false)} onPress={() =>
navigateToUri(
navigation,
normalizeURI(repostChannelUrl || `@${repostChannel}`),
null,
false,
null,
false,
)
}
/>{' '} />{' '}
reposted reposted
</Text> </Text>

View file

@ -411,6 +411,7 @@ const publishStyle = StyleSheet.create({
marginTop: 60, marginTop: 60,
}, },
publishesScrollPadding: { publishesScrollPadding: {
paddingTop: 16,
paddingBottom: 16, paddingBottom: 16,
}, },
listItem: { listItem: {
@ -418,8 +419,9 @@ const publishStyle = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
marginTop: 8, marginTop: 8,
marginLeft: 8, marginLeft: 16,
marginRight: 8, marginRight: 16,
marginBottom: 12,
}, },
noVideos: { noVideos: {
color: Colors.White, color: Colors.White,
@ -443,13 +445,13 @@ const publishStyle = StyleSheet.create({
}, },
publishesFooter: { publishesFooter: {
marginTop: 2, marginTop: 2,
marginLeft: 16, marginLeft: 8,
marginRight: 16, marginRight: 8,
}, },
publishesFooterButton: { publishesFooterButton: {
alignSelf: 'flex-start', alignSelf: 'flex-start',
backgroundColor: Colors.LbryGreen, backgroundColor: Colors.LbryGreen,
marginTop: 16, marginTop: 8,
}, },
thumbnailEditOverlay: { thumbnailEditOverlay: {
alignItems: 'center', alignItems: 'center',