make empty feed required (#1667)
parent
4d450da194
commit
aa085b0b14
|
@ -45,7 +45,7 @@ export const Feed = observer(function Feed({
|
||||||
onPressTryAgain?: () => void
|
onPressTryAgain?: () => void
|
||||||
onScroll?: OnScrollCb
|
onScroll?: OnScrollCb
|
||||||
scrollEventThrottle?: number
|
scrollEventThrottle?: number
|
||||||
renderEmptyState?: () => JSX.Element
|
renderEmptyState: () => JSX.Element
|
||||||
renderEndOfFeed?: () => JSX.Element
|
renderEndOfFeed?: () => JSX.Element
|
||||||
testID?: string
|
testID?: string
|
||||||
headerOffset?: number
|
headerOffset?: number
|
||||||
|
@ -116,10 +116,7 @@ export const Feed = observer(function Feed({
|
||||||
const renderItem = React.useCallback(
|
const renderItem = React.useCallback(
|
||||||
({item}: {item: any}) => {
|
({item}: {item: any}) => {
|
||||||
if (item === EMPTY_FEED_ITEM) {
|
if (item === EMPTY_FEED_ITEM) {
|
||||||
if (renderEmptyState) {
|
|
||||||
return renderEmptyState()
|
return renderEmptyState()
|
||||||
}
|
|
||||||
return <View />
|
|
||||||
} else if (item === ERROR_ITEM) {
|
} else if (item === ERROR_ITEM) {
|
||||||
return (
|
return (
|
||||||
<ErrorMessage
|
<ErrorMessage
|
||||||
|
|
|
@ -160,7 +160,7 @@ const FeedPage = observer(function FeedPageImpl({
|
||||||
testID?: string
|
testID?: string
|
||||||
feed: PostsFeedModel
|
feed: PostsFeedModel
|
||||||
isPageFocused: boolean
|
isPageFocused: boolean
|
||||||
renderEmptyState?: () => JSX.Element
|
renderEmptyState: () => JSX.Element
|
||||||
renderEndOfFeed?: () => JSX.Element
|
renderEndOfFeed?: () => JSX.Element
|
||||||
}) {
|
}) {
|
||||||
const store = useStores()
|
const store = useStores()
|
||||||
|
|
Loading…
Reference in New Issue