Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Hide the mobile reply control if outside the threadgate (#2177)

authored by

Paul Frazee and committed by
GitHub
3592f6f5 9a59525b

+11 -2
+8 -1
src/view/com/post-thread/PostThread.tsx
··· 1 - import React, {useRef} from 'react' 1 + import React, {useEffect, useRef} from 'react' 2 2 import { 3 3 ActivityIndicator, 4 4 Pressable, ··· 64 64 65 65 export function PostThread({ 66 66 uri, 67 + onCanReply, 67 68 onPressReply, 68 69 }: { 69 70 uri: string | undefined 71 + onCanReply: (canReply: boolean) => void 70 72 onPressReply: () => void 71 73 }) { 72 74 const { ··· 86 88 rootPost.author.displayName || `@${rootPost.author.handle}`, 87 89 )}: "${rootPostRecord?.text}"`, 88 90 ) 91 + useEffect(() => { 92 + if (rootPost) { 93 + onCanReply(!rootPost.viewer?.replyDisabled) 94 + } 95 + }, [rootPost, onCanReply]) 89 96 90 97 if (isError || AppBskyFeedDefs.isNotFoundPost(thread)) { 91 98 return (
+3 -1
src/view/screens/PostThread.tsx
··· 37 37 const {isMobile} = useWebMediaQueries() 38 38 const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey) 39 39 const {data: resolvedUri, error: uriError} = useResolveUriQuery(uri) 40 + const [canReply, setCanReply] = React.useState(false) 40 41 41 42 useFocusEffect( 42 43 React.useCallback(() => { ··· 84 85 <PostThreadComponent 85 86 uri={resolvedUri?.uri} 86 87 onPressReply={onPressReply} 88 + onCanReply={setCanReply} 87 89 /> 88 90 )} 89 91 </View> 90 - {isMobile && ( 92 + {isMobile && canReply && ( 91 93 <Animated.View 92 94 style={[ 93 95 styles.prompt,