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