Add WIP post-thread view
This commit is contained in:
parent
19c694bc60
commit
c712cbbfe2
14 changed files with 534 additions and 25 deletions
|
@ -1,20 +1,23 @@
|
|||
import React, {useEffect} from 'react'
|
||||
import {Text, View} from 'react-native'
|
||||
import {View} from 'react-native'
|
||||
import {Shell} from '../shell'
|
||||
import {Feed} from '../com/Feed'
|
||||
// import type {RootTabsScreenProps} from '../routes/types'
|
||||
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<'Home'>) {
|
||||
const store = useStores()
|
||||
useEffect(() => {
|
||||
console.log('Fetching home feed')
|
||||
store.homeFeed.setup()
|
||||
}, [store.homeFeed])
|
||||
const onNavigateContent = (screen: string, props: Record<string, string>) => {
|
||||
navigation.navigate(screen, props)
|
||||
}
|
||||
return (
|
||||
<Shell>
|
||||
<View>
|
||||
<Feed feed={store.homeFeed} />
|
||||
<Feed feed={store.homeFeed} onNavigateContent={onNavigateContent} />
|
||||
</View>
|
||||
</Shell>
|
||||
)
|
||||
|
|
27
src/view/screens/content/PostThread.tsx
Normal file
27
src/view/screens/content/PostThread.tsx
Normal file
|
@ -0,0 +1,27 @@
|
|||
import React from 'react'
|
||||
import {AdxUri} from '@adxp/mock-api'
|
||||
import {Shell} from '../../shell'
|
||||
import type {RootTabsScreenProps} from '../../routes/types'
|
||||
import {PostThread as PostThreadComponent} from '../../com/post-thread/PostThread'
|
||||
|
||||
export const PostThread = ({
|
||||
navigation,
|
||||
route,
|
||||
}: RootTabsScreenProps<'PostThread'>) => {
|
||||
const {name, recordKey} = route.params
|
||||
|
||||
const urip = new AdxUri(`adx://todo/`)
|
||||
urip.host = name
|
||||
urip.collection = 'blueskyweb.xyz:Posts'
|
||||
urip.recordKey = recordKey
|
||||
const uri = urip.toString()
|
||||
|
||||
const onNavigateContent = (screen: string, props: Record<string, string>) => {
|
||||
navigation.navigate(screen, props)
|
||||
}
|
||||
return (
|
||||
<Shell>
|
||||
<PostThreadComponent uri={uri} onNavigateContent={onNavigateContent} />
|
||||
</Shell>
|
||||
)
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react'
|
||||
import {Shell} from '../shell'
|
||||
import {Shell} from '../../shell'
|
||||
import {View, Text} from 'react-native'
|
||||
import type {RootTabsScreenProps} from '../routes/types'
|
||||
import type {RootTabsScreenProps} from '../../routes/types'
|
||||
|
||||
export const Profile = ({route}: RootTabsScreenProps<'Profile'>) => {
|
||||
return (
|
Loading…
Add table
Add a link
Reference in a new issue