From 89fc356eb79ffcd6e4a990ef48db936d6b900fe5 Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Mon, 10 Jun 2024 14:35:02 +0900 Subject: [PATCH] Update FeedItem.tsx --- src/view/com/notifications/FeedItem.tsx | 106 +++++++++++++++++------- 1 file changed, 75 insertions(+), 31 deletions(-) diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx index 24a119e1e2..c8d0001b93 100644 --- a/src/view/com/notifications/FeedItem.tsx +++ b/src/view/com/notifications/FeedItem.tsx @@ -1,4 +1,4 @@ -import React, {memo, useEffect, useMemo, useState} from 'react' +import React, {memo, ReactElement, useEffect, useMemo, useState} from 'react' import { Animated, Pressable, @@ -154,7 +154,22 @@ let FeedItem = ({ ) } - let action = '' + let formattedCount = authors.length > 1 ? formatCount(authors.length - 1) : '' + + let author = ( + + ) + + let action: ReactElement + let actionPlural: ReactElement let icon = ( ) + if (item.type === 'post-like') { - action = _(msg`liked your post`) + action = {author} liked your post + actionPlural = ( + + {author} and{' '} + + + {' '} + liked your post + + ) } else if (item.type === 'repost') { - action = _(msg`reposted your post`) + action = {author} reposted your post + actionPlural = ( + + {author} and{' '} + + + {' '} + reposted your post + + ) icon = } else if (item.type === 'follow') { - action = _(msg`followed you`) + action = {author} followed you + actionPlural = ( + + {author} and{' '} + + + {' '} + followed you + + ) icon = } else if (item.type === 'feedgen-like') { - action = _(msg`liked your custom feed`) + action = {author} liked your custom feed + actionPlural = ( + + {author} and{' '} + + + {' '} + liked your custom feed + + ) } else { return null } - let formattedCount = authors.length > 1 ? formatCount(authors.length - 1) : '' return ( - - - {authors.length > 1 ? ( - - and - - - - - ) : undefined} - {action} - + {authors.length > 1 ? actionPlural : action} {({timeElapsed}) => (