mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at thread-bug 38 lines 1.2 kB view raw
1import {useCallback} from 'react' 2import {useFocusEffect} from '@react-navigation/native' 3 4import { 5 type CommonNavigatorParams, 6 type NativeStackScreenProps, 7} from '#/lib/routes/types' 8import {useGate} from '#/lib/statsig/statsig' 9import {makeRecordUri} from '#/lib/strings/url-helpers' 10import {useSetMinimalShellMode} from '#/state/shell' 11import {PostThread as PostThreadComponent} from '#/view/com/post-thread/PostThread' 12import {PostThread} from '#/screens/PostThread' 13import * as Layout from '#/components/Layout' 14 15type Props = NativeStackScreenProps<CommonNavigatorParams, 'PostThread'> 16export function PostThreadScreen({route}: Props) { 17 const setMinimalShellMode = useSetMinimalShellMode() 18 const gate = useGate() 19 20 const {name, rkey} = route.params 21 const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey) 22 23 useFocusEffect( 24 useCallback(() => { 25 setMinimalShellMode(false) 26 }, [setMinimalShellMode]), 27 ) 28 29 return ( 30 <Layout.Screen testID="postThreadScreen"> 31 {gate('post_threads_v2_unspecced') || __DEV__ ? ( 32 <PostThread uri={uri} /> 33 ) : ( 34 <PostThreadComponent uri={uri} /> 35 )} 36 </Layout.Screen> 37 ) 38}