From f5c4a97eaff92e37f18562f1cb6c4fb209c4bc09 Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Tue, 4 Oct 2022 14:22:20 -0500
Subject: Add firehose view to home screen

---
 src/view/com/posts/Feed.tsx | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 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 037d71a13..028480eb4 100644
--- a/src/view/com/posts/Feed.tsx
+++ b/src/view/com/posts/Feed.tsx
@@ -1,17 +1,21 @@
 import React from 'react'
 import {observer} from 'mobx-react-lite'
-import {Text, View, FlatList} from 'react-native'
-import {FeedViewModel, FeedViewItemModel} from '../../../state/models/feed-view'
+import {Text, View, FlatList, StyleProp, ViewStyle} from 'react-native'
+import {FeedModel, FeedItemModel} from '../../../state/models/feed-view'
 import {FeedItem} from './FeedItem'
 
-export const Feed = observer(function Feed({feed}: {feed: FeedViewModel}) {
+export const Feed = observer(function Feed({
+  feed,
+  style,
+}: {
+  feed: FeedModel
+  style?: StyleProp<ViewStyle>
+}) {
   // TODO optimize renderItem or FeedItem, we're getting this notice from RN: -prf
   //   VirtualizedList: You have a large list that is slow to update - make sure your
   //   renderItem function renders components that follow React performance best practices
   //   like PureComponent, shouldComponentUpdate, etc
-  const renderItem = ({item}: {item: FeedViewItemModel}) => (
-    <FeedItem item={item} />
-  )
+  const renderItem = ({item}: {item: FeedItemModel}) => <FeedItem item={item} />
   const onRefresh = () => {
     feed.refresh().catch(err => console.error('Failed to refresh', err))
   }
@@ -19,7 +23,7 @@ export const Feed = observer(function Feed({feed}: {feed: FeedViewModel}) {
     feed.loadMore().catch(err => console.error('Failed to load more', err))
   }
   return (
-    <View>
+    <View style={style}>
       {feed.isLoading && !feed.isRefreshing && !feed.hasContent && (
         <Text>Loading...</Text>
       )}
-- 
cgit 1.4.1

