Wrap the post thread screen in an observer (#1509)

zio/stable
Paul Frazee 2023-09-21 17:36:50 -07:00 committed by GitHub
parent 44985d2312
commit 1abe5270dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 70 additions and 67 deletions

View File

@ -1,6 +1,7 @@
import React, {useMemo} from 'react' import React, {useMemo} from 'react'
import {InteractionManager, StyleSheet, View} from 'react-native' import {InteractionManager, StyleSheet, View} from 'react-native'
import {useFocusEffect} from '@react-navigation/native' import {useFocusEffect} from '@react-navigation/native'
import {observer} from 'mobx-react-lite'
import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types' import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types'
import {makeRecordUri} from 'lib/strings/url-helpers' import {makeRecordUri} from 'lib/strings/url-helpers'
import {withAuthRequired} from 'view/com/auth/withAuthRequired' import {withAuthRequired} from 'view/com/auth/withAuthRequired'
@ -17,7 +18,8 @@ import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
const SHELL_FOOTER_HEIGHT = 44 const SHELL_FOOTER_HEIGHT = 44
type Props = NativeStackScreenProps<CommonNavigatorParams, 'PostThread'> type Props = NativeStackScreenProps<CommonNavigatorParams, 'PostThread'>
export const PostThreadScreen = withAuthRequired(({route}: Props) => { export const PostThreadScreen = withAuthRequired(
observer(function PostThreadScreenImpl({route}: Props) {
const store = useStores() const store = useStores()
const safeAreaInsets = useSafeAreaInsets() const safeAreaInsets = useSafeAreaInsets()
const {name, rkey} = route.params const {name, rkey} = route.params
@ -91,7 +93,8 @@ export const PostThreadScreen = withAuthRequired(({route}: Props) => {
)} )}
</View> </View>
) )
}) }),
)
const styles = StyleSheet.create({ const styles = StyleSheet.create({
prompt: { prompt: {