about summary refs log tree commit diff
path: root/src/view/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/screens')
-rw-r--r--src/view/screens/Home.tsx5
-rw-r--r--src/view/screens/Menu.tsx2
-rw-r--r--src/view/screens/NotFound.tsx2
-rw-r--r--src/view/screens/Notifications.tsx4
-rw-r--r--src/view/screens/Search.tsx2
-rw-r--r--src/view/screens/content/PostThread.tsx19
6 files changed, 27 insertions, 7 deletions
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx
index 4a3e41a75..1b41b2d35 100644
--- a/src/view/screens/Home.tsx
+++ b/src/view/screens/Home.tsx
@@ -5,15 +5,18 @@ import {Feed} from '../com/feed/Feed'
 import type {RootTabsScreenProps} from '../routes/types'
 import {useStores} from '../../state'
 
-export function Home({navigation}: RootTabsScreenProps<'Home'>) {
+export function Home({navigation}: RootTabsScreenProps<'HomeTab'>) {
   const store = useStores()
   useEffect(() => {
     console.log('Fetching home feed')
     store.homeFeed.setup()
   }, [store.homeFeed])
+
   const onNavigateContent = (screen: string, props: Record<string, string>) => {
+    // @ts-ignore it's up to the callers to supply correct params -prf
     navigation.navigate(screen, props)
   }
+
   return (
     <Shell>
       <View>
diff --git a/src/view/screens/Menu.tsx b/src/view/screens/Menu.tsx
index 8cf93676e..d0cc0826f 100644
--- a/src/view/screens/Menu.tsx
+++ b/src/view/screens/Menu.tsx
@@ -3,7 +3,7 @@ import {Shell} from '../shell'
 import {ScrollView, Text, View} from 'react-native'
 import type {RootTabsScreenProps} from '../routes/types'
 
-export const Menu = (_props: RootTabsScreenProps<'Menu'>) => {
+export const Menu = (_props: RootTabsScreenProps<'MenuTab'>) => {
   return (
     <Shell>
       <ScrollView contentInsetAdjustmentBehavior="automatic">
diff --git a/src/view/screens/NotFound.tsx b/src/view/screens/NotFound.tsx
index 3f6dd7aa0..5357a428a 100644
--- a/src/view/screens/NotFound.tsx
+++ b/src/view/screens/NotFound.tsx
@@ -8,7 +8,7 @@ export const NotFound = ({navigation}: RootTabsScreenProps<'NotFound'>) => {
     <Shell>
       <View style={{justifyContent: 'center', alignItems: 'center'}}>
         <Text style={{fontSize: 20, fontWeight: 'bold'}}>Page not found</Text>
-        <Button title="Home" onPress={() => navigation.navigate('Home')} />
+        <Button title="Home" onPress={() => navigation.navigate('HomeTab')} />
       </View>
     </Shell>
   )
diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx
index 5bade68fa..a7918f177 100644
--- a/src/view/screens/Notifications.tsx
+++ b/src/view/screens/Notifications.tsx
@@ -3,7 +3,9 @@ import {Shell} from '../shell'
 import {Text, View} from 'react-native'
 import type {RootTabsScreenProps} from '../routes/types'
 
-export const Notifications = (_props: RootTabsScreenProps<'Notifications'>) => {
+export const Notifications = (
+  _props: RootTabsScreenProps<'NotificationsTab'>,
+) => {
   return (
     <Shell>
       <View style={{justifyContent: 'center', alignItems: 'center'}}>
diff --git a/src/view/screens/Search.tsx b/src/view/screens/Search.tsx
index 2f111cf72..26df2954c 100644
--- a/src/view/screens/Search.tsx
+++ b/src/view/screens/Search.tsx
@@ -3,7 +3,7 @@ import {Shell} from '../shell'
 import {Text, View} from 'react-native'
 import type {RootTabsScreenProps} from '../routes/types'
 
-export const Search = (_props: RootTabsScreenProps<'Search'>) => {
+export const Search = (_props: RootTabsScreenProps<'SearchTab'>) => {
   return (
     <Shell>
       <View style={{justifyContent: 'center', alignItems: 'center'}}>
diff --git a/src/view/screens/content/PostThread.tsx b/src/view/screens/content/PostThread.tsx
index 5b8fa951c..e990bcc1b 100644
--- a/src/view/screens/content/PostThread.tsx
+++ b/src/view/screens/content/PostThread.tsx
@@ -1,4 +1,6 @@
-import React from 'react'
+import React, {useLayoutEffect} from 'react'
+import {TouchableOpacity} from 'react-native'
+import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
 import {AdxUri} from '@adxp/mock-api'
 import {Shell} from '../../shell'
 import type {RootTabsScreenProps} from '../../routes/types'
@@ -16,8 +18,21 @@ export const PostThread = ({
   urip.recordKey = recordKey
   const uri = urip.toString()
 
+  useLayoutEffect(() => {
+    navigation.setOptions({
+      headerShown: true,
+      headerTitle: 'Thread',
+      headerLeft: () => (
+        <TouchableOpacity onPress={() => navigation.goBack()}>
+          <FontAwesomeIcon icon="arrow-left" />
+        </TouchableOpacity>
+      ),
+    })
+  }, [navigation])
+
   const onNavigateContent = (screen: string, props: Record<string, string>) => {
-    navigation.navigate(screen, props)
+    // @ts-ignore it's up to the callers to supply correct params -prf
+    navigation.push(screen, props)
   }
   return (
     <Shell>