Skip to content

Commit

Permalink
fix(courses): add empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
FabrizioCostaMedich committed Oct 31, 2024
1 parent b0c5822 commit ea78ef4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/features/courses/screens/CourseDirectoryScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { useCallback, useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { FlatList, Platform, StyleSheet } from 'react-native';

import { faFile } from '@fortawesome/free-regular-svg-icons';
import { faFile, faFolderOpen } from '@fortawesome/free-regular-svg-icons';
import { faSearch } from '@fortawesome/free-solid-svg-icons';
import { CtaButton } from '@lib/ui/components/CtaButton';
import { EmptyState } from '@lib/ui/components/EmptyState';
import { IndentedDivider } from '@lib/ui/components/IndentedDivider';
import { RefreshControl } from '@lib/ui/components/RefreshControl';
import { Row } from '@lib/ui/components/Row';
Expand Down Expand Up @@ -113,6 +114,14 @@ export const CourseDirectoryScreen = ({ route, navigation }: Props) => {
ios: IndentedDivider,
})}
ListFooterComponent={<BottomBarSpacer />}
ListEmptyComponent={
!directoryQuery.isLoading ? (
<EmptyState
message={t('courseFilesTab.empty')}
icon={faFolderOpen}
/>
) : null
}
/>
)}
</CourseFilesCacheProvider>
Expand Down

0 comments on commit ea78ef4

Please sign in to comment.