Update FeedItem.tsx

This commit is contained in:
Minseo Lee
2024-06-10 15:01:40 +09:00
parent d8adcae539
commit 564e55bcaa
+17 -10
View File
@@ -169,7 +169,6 @@ let FeedItem = ({
)
let action: ReactElement
let actionPlural: ReactElement
let icon = (
<HeartIconFilled
size="xl"
@@ -181,8 +180,8 @@ let FeedItem = ({
)
if (item.type === 'post-like') {
action = <Trans>{author} liked your post</Trans>
actionPlural = (
action =
authors.length > 1 ? (
<Trans>
{author} and{' '}
<Text style={[pal.text, s.bold]}>
@@ -194,10 +193,12 @@ let FeedItem = ({
</Text>{' '}
liked your post
</Trans>
) : (
<Trans>{author} liked your post</Trans>
)
} else if (item.type === 'repost') {
action = <Trans>{author} reposted your post</Trans>
actionPlural = (
action =
authors.length > 1 ? (
<Trans>
{author} and{' '}
<Text style={[pal.text, s.bold]}>
@@ -209,11 +210,13 @@ let FeedItem = ({
</Text>{' '}
reposted your post
</Trans>
) : (
<Trans>{author} reposted your post</Trans>
)
icon = <RepostIcon size="xl" style={{color: t.palette.positive_600}} />
} else if (item.type === 'follow') {
action = <Trans>{author} followed you</Trans>
actionPlural = (
action =
authors.length > 1 ? (
<Trans>
{author} and{' '}
<Text style={[pal.text, s.bold]}>
@@ -225,11 +228,13 @@ let FeedItem = ({
</Text>{' '}
followed you
</Trans>
) : (
<Trans>{author} followed you</Trans>
)
icon = <PersonPlusIcon size="xl" style={{color: t.palette.primary_500}} />
} else if (item.type === 'feedgen-like') {
action = <Trans>{author} liked your custom feed</Trans>
actionPlural = (
action =
authors.length > 1 ? (
<Trans>
{author} and{' '}
<Text style={[pal.text, s.bold]}>
@@ -241,6 +246,8 @@ let FeedItem = ({
</Text>{' '}
liked your custom feed
</Trans>
) : (
<Trans>{author} liked your custom feed</Trans>
)
} else {
return null
@@ -309,7 +316,7 @@ let FeedItem = ({
/>
<ExpandedAuthorsList visible={isAuthorsExpanded} authors={authors} />
<Text style={[styles.meta, pal.text]}>
{authors.length > 1 ? actionPlural : action}
{action}
<TimeElapsed timestamp={item.notification.indexedAt}>
{({timeElapsed}) => (
<Text