From 59c1b545fad5883487777f0a36ee21f3791aa268 Mon Sep 17 00:00:00 2001 From: Ansh Nanda Date: Tue, 16 May 2023 19:04:47 -0700 Subject: fix routing on web --- src/view/com/posts/Feed.tsx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/view/com/posts/Feed.tsx') diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx index 998cfe0c9..443cf70bd 100644 --- a/src/view/com/posts/Feed.tsx +++ b/src/view/com/posts/Feed.tsx @@ -34,6 +34,7 @@ export const Feed = observer(function Feed({ renderEmptyState, testID, headerOffset = 0, + ListHeaderComponent, }: { feed: PostsFeedModel style?: StyleProp @@ -44,6 +45,7 @@ export const Feed = observer(function Feed({ renderEmptyState?: () => JSX.Element testID?: string headerOffset?: number + ListHeaderComponent?: () => JSX.Element }) { const pal = usePalette('default') const {track} = useAnalytics() @@ -163,6 +165,7 @@ export const Feed = observer(function Feed({ keyExtractor={item => item._reactKey} renderItem={renderItem} ListFooterComponent={FeedFooter} + ListHeaderComponent={ListHeaderComponent} refreshControl={ Date: Tue, 16 May 2023 23:45:14 -0700 Subject: fix re-rendering issue --- src/view/com/posts/Feed.tsx | 3 ++ src/view/screens/CustomFeed.tsx | 114 ++++++++++++++++++++-------------------- 2 files changed, 61 insertions(+), 56 deletions(-) (limited to 'src/view/com/posts/Feed.tsx') diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx index 443cf70bd..5b0110df8 100644 --- a/src/view/com/posts/Feed.tsx +++ b/src/view/com/posts/Feed.tsx @@ -35,6 +35,7 @@ export const Feed = observer(function Feed({ testID, headerOffset = 0, ListHeaderComponent, + extraData, }: { feed: PostsFeedModel style?: StyleProp @@ -46,6 +47,7 @@ export const Feed = observer(function Feed({ testID?: string headerOffset?: number ListHeaderComponent?: () => JSX.Element + extraData?: any }) { const pal = usePalette('default') const {track} = useAnalytics() @@ -182,6 +184,7 @@ export const Feed = observer(function Feed({ onEndReachedThreshold={0.6} removeClippedSubviews={true} contentOffset={{x: 0, y: headerOffset * -1}} + extraData={extraData} // @ts-ignore our .web version only -prf desktopFixedHeight /> diff --git a/src/view/screens/CustomFeed.tsx b/src/view/screens/CustomFeed.tsx index 63cbfcca8..5c19556e2 100644 --- a/src/view/screens/CustomFeed.tsx +++ b/src/view/screens/CustomFeed.tsx @@ -28,7 +28,6 @@ export const CustomFeed = withAuthRequired( [rkey, name], ) const currentFeed = useCustomFeed(uri) - const pal = usePalette('default') const scrollElRef = useRef(null) const algoFeed: PostsFeedModel = useMemo(() => { const feed = new PostsFeedModel(rootStore, 'custom', { @@ -38,59 +37,6 @@ export const CustomFeed = withAuthRequired( return feed }, [rootStore, uri]) - const _ListHeaderComponent = () => { - return ( - - - - - - - @{currentFeed?.data.creator.handle} - - - - {currentFeed?.data.description} - - - -