diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-12-11 15:11:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-11 15:11:36 -0800 |
commit | 3592f6f50b98c6bc81ebbf50f11f85df23376e53 (patch) | |
tree | bf1d3a8351e04e0a489732da6e7322c3655c5346 /src/view/com/post-thread/PostThread.tsx | |
parent | 9a59525b7313380507173984fd94fc92cb8c8709 (diff) | |
download | voidsky-3592f6f50b98c6bc81ebbf50f11f85df23376e53.tar.zst |
Hide the mobile reply control if outside the threadgate (#2177)
Diffstat (limited to 'src/view/com/post-thread/PostThread.tsx')
-rw-r--r-- | src/view/com/post-thread/PostThread.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx index 633968c87..051bc7849 100644 --- a/src/view/com/post-thread/PostThread.tsx +++ b/src/view/com/post-thread/PostThread.tsx @@ -1,4 +1,4 @@ -import React, {useRef} from 'react' +import React, {useEffect, useRef} from 'react' import { ActivityIndicator, Pressable, @@ -64,9 +64,11 @@ type YieldedItem = export function PostThread({ uri, + onCanReply, onPressReply, }: { uri: string | undefined + onCanReply: (canReply: boolean) => void onPressReply: () => void }) { const { @@ -86,6 +88,11 @@ export function PostThread({ rootPost.author.displayName || `@${rootPost.author.handle}`, )}: "${rootPostRecord?.text}"`, ) + useEffect(() => { + if (rootPost) { + onCanReply(!rootPost.viewer?.replyDisabled) + } + }, [rootPost, onCanReply]) if (isError || AppBskyFeedDefs.isNotFoundPost(thread)) { return ( |