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