about summary refs log tree commit diff
path: root/src/view/com/posts/FeedItem.tsx
diff options
context:
space:
mode:
authorSnackpackWayne <49062420+snackpackwayne@users.noreply.github.com>2023-12-27 22:38:01 +0100
committerGitHub <noreply@github.com>2023-12-27 22:38:01 +0100
commit52cb777c9432354302b3285e141aa96632af34d5 (patch)
tree0b823b5816f040990af0ee2fc7815a2f1a063fca /src/view/com/posts/FeedItem.tsx
parent538c67cc332a6b909f83dd382843667dcced0fe9 (diff)
parentf402f33a024ea59ea9bd2decfc0444e6836a934c (diff)
downloadvoidsky-52cb777c9432354302b3285e141aa96632af34d5.tar.zst
Merge branch 'main' into patch-1
Diffstat (limited to 'src/view/com/posts/FeedItem.tsx')
-rw-r--r--src/view/com/posts/FeedItem.tsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx
index 2be314266..942d7bf71 100644
--- a/src/view/com/posts/FeedItem.tsx
+++ b/src/view/com/posts/FeedItem.tsx
@@ -34,6 +34,7 @@ import {countLines} from 'lib/strings/helpers'
 import {useComposerControls} from '#/state/shell/composer'
 import {Shadow, usePostShadow, POST_TOMBSTONE} from '#/state/cache/post-shadow'
 import {FeedNameText} from '../util/FeedInfoText'
+import {useSession} from '#/state/session'
 
 export function FeedItem({
   post,
@@ -102,10 +103,14 @@ let FeedItemInner = ({
 }): React.ReactNode => {
   const {openComposer} = useComposerControls()
   const pal = usePalette('default')
+  const {currentAccount} = useSession()
   const href = useMemo(() => {
     const urip = new AtUri(post.uri)
     return makeProfileLink(post.author, 'post', urip.rkey)
   }, [post.uri, post.author])
+  const isModeratedPost =
+    moderation.decisions.post.cause?.type === 'label' &&
+    moderation.decisions.post.cause.label.src !== currentAccount?.did
 
   const replyAuthorDid = useMemo(() => {
     if (!record?.reply) {
@@ -284,7 +289,14 @@ let FeedItemInner = ({
             postEmbed={post.embed}
             postAuthor={post.author}
           />
-          <PostCtrls post={post} record={record} onPressReply={onPressReply} />
+          <PostCtrls
+            post={post}
+            record={record}
+            onPressReply={onPressReply}
+            showAppealLabelItem={
+              post.author.did === currentAccount?.did && isModeratedPost
+            }
+          />
         </View>
       </View>
     </Link>