about summary refs log tree commit diff
path: root/src/view/com/post/Post.tsx
diff options
context:
space:
mode:
authorMinseo Lee <itoupluk427@gmail.com>2024-07-12 11:42:27 +0900
committerGitHub <noreply@github.com>2024-07-11 19:42:27 -0700
commita71134f467449bc4c74967ca3958416feac6b91d (patch)
treede374bd0eb3455b21e706f58fd39123e84b168da /src/view/com/post/Post.tsx
parent8b121af2e438ca77cc5f5b1715516107c18aff6f (diff)
downloadvoidsky-a71134f467449bc4c74967ca3958416feac6b91d.tar.zst
`Reposted by you` and `Reply to you` (#4478)
Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/view/com/post/Post.tsx')
-rw-r--r--src/view/com/post/Post.tsx30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx
index 51a1381ec..a05339d4d 100644
--- a/src/view/com/post/Post.tsx
+++ b/src/view/com/post/Post.tsx
@@ -15,6 +15,7 @@ import {useQueryClient} from '@tanstack/react-query'
 import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
 import {POST_TOMBSTONE, Shadow, usePostShadow} from '#/state/cache/post-shadow'
 import {useModerationOpts} from '#/state/preferences/moderation-opts'
+import {useSession} from '#/state/session'
 import {useComposerControls} from '#/state/shell/composer'
 import {MAX_POST_LINES} from 'lib/constants'
 import {usePalette} from 'lib/hooks/usePalette'
@@ -145,6 +146,9 @@ function PostInner({
     precacheProfile(queryClient, post.author)
   }, [queryClient, post.author])
 
+  const {currentAccount} = useSession()
+  const isMe = replyAuthorDid === currentAccount?.did
+
   return (
     <Link
       href={itemHref}
@@ -187,17 +191,21 @@ function PostInner({
                 style={[pal.textLight, s.mr2]}
                 lineHeight={1.2}
                 numberOfLines={1}>
-                <Trans context="description">
-                  Reply to{' '}
-                  <ProfileHoverCard inline did={replyAuthorDid}>
-                    <UserInfoText
-                      type="sm"
-                      did={replyAuthorDid}
-                      attr="displayName"
-                      style={[pal.textLight]}
-                    />
-                  </ProfileHoverCard>
-                </Trans>
+                {isMe ? (
+                  <Trans context="description">Reply to you</Trans>
+                ) : (
+                  <Trans context="description">
+                    Reply to{' '}
+                    <ProfileHoverCard inline did={replyAuthorDid}>
+                      <UserInfoText
+                        type="sm"
+                        did={replyAuthorDid}
+                        attr="displayName"
+                        style={[pal.textLight]}
+                      />
+                    </ProfileHoverCard>
+                  </Trans>
+                )}
               </Text>
             </View>
           )}