diff --git a/packages/shared-components/src/components/cards/EmptyCards.tsx b/packages/shared-components/src/components/cards/EmptyCards.tsx index 43294ca8..4273b7a8 100644 --- a/packages/shared-components/src/components/cards/EmptyCards.tsx +++ b/packages/shared-components/src/components/cards/EmptyCards.tsx @@ -1,5 +1,5 @@ import React, { useContext } from 'react' -import { Text, View } from 'react-native' +import { ActivityIndicator, Text, View } from 'react-native' import { contentPadding } from '../../styles/variables' import { Button } from '../common/Button' @@ -33,11 +33,14 @@ const emoji = getRandomEmoji() export interface EmptyCardsProps { fetchNextPage: ((params?: { perPage?: number }) => void) | undefined + state: 'loading' | 'loading_first' | 'loading_more' | 'loaded' } export function EmptyCards(props: EmptyCardsProps) { const { theme } = useContext(ThemeContext) + const { fetchNextPage, state } = props + return ( - - {clearMessage} {emoji} - + {state === 'loading_first' ? ( + + ) : ( + + {clearMessage} {emoji} + + )} - {!!props.fetchNextPage && ( + {!!fetchNextPage && (