make empty feed required (#1667)

zio/stable
Ansh 2023-10-10 14:32:00 -07:00 committed by GitHub
parent 4d450da194
commit aa085b0b14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -45,7 +45,7 @@ export const Feed = observer(function Feed({
onPressTryAgain?: () => void
onScroll?: OnScrollCb
scrollEventThrottle?: number
renderEmptyState?: () => JSX.Element
renderEmptyState: () => JSX.Element
renderEndOfFeed?: () => JSX.Element
testID?: string
headerOffset?: number
@ -116,10 +116,7 @@ export const Feed = observer(function Feed({
const renderItem = React.useCallback(
({item}: {item: any}) => {
if (item === EMPTY_FEED_ITEM) {
if (renderEmptyState) {
return renderEmptyState()
}
return <View />
} else if (item === ERROR_ITEM) {
return (
<ErrorMessage

View File

@ -160,7 +160,7 @@ const FeedPage = observer(function FeedPageImpl({
testID?: string
feed: PostsFeedModel
isPageFocused: boolean
renderEmptyState?: () => JSX.Element
renderEmptyState: () => JSX.Element
renderEndOfFeed?: () => JSX.Element
}) {
const store = useStores()