diff --git a/src/screens/History.tsx b/src/screens/History.tsx index 5c71f8e..dfd0fc4 100644 --- a/src/screens/History.tsx +++ b/src/screens/History.tsx @@ -10,6 +10,7 @@ import { HistoryByDayDTO } from '@dtos/HistoryByDayDTO'; import { HistoryCard } from '@components/HistoryCard'; import { ScreenHeader } from '@components/ScreenHeader'; import { ToastMessage } from '@components/ToastMessage'; +import { Loading } from '@components/Loading'; export function History() { const [isLoading, setIsLoading] = useState(true); @@ -47,24 +48,28 @@ export function History() { - item.id} - renderItem={({ item }) => } - renderSectionHeader={({ section }) => ( - - {section.title} - - )} - style={{ paddingHorizontal: 32 }} - contentContainerStyle={exercises.length === 0 && { flex: 1, justifyContent: 'center' }} - ListEmptyComponent={() => ( - - Não há exercícios registrados ainda.{'\n'}Vamos fazer exercícios hoje? - - )} - showsVerticalScrollIndicator={false} - /> + {isLoading ? ( + + ) : ( + item.id} + renderItem={({ item }) => } + renderSectionHeader={({ section }) => ( + + {section.title} + + )} + style={{ paddingHorizontal: 32 }} + contentContainerStyle={exercises.length === 0 && { flex: 1, justifyContent: 'center' }} + ListEmptyComponent={() => ( + + Não há exercícios registrados ainda.{'\n'}Vamos fazer exercícios hoje? + + )} + showsVerticalScrollIndicator={false} + /> + )} ); }