diff --git a/app/src/components/ListEmptyContainer.js b/app/src/components/ListEmptyContainer.js index f848a86f2..c9ea41473 100644 --- a/app/src/components/ListEmptyContainer.js +++ b/app/src/components/ListEmptyContainer.js @@ -12,8 +12,11 @@ export const ListEmptyActions = () => ; export const ListEmptyStructures = () => ; export const ListEmptyTerritories = () => ; +export const ListEmptyObservations = () => ; export const ListEmptyStructureWithName = (name) => () => ; export const ListEmptyPlaceWithName = (name) => () => ; +export const ListEmptyComments = () => ; +export const ListEmptyRencontres = () => ; export const ListEmptyCollaboration = (collaboration) => () => ; export const ListEmptyUrgent = () => ; export const ListEmptyUrgentAction = () => ; @@ -21,6 +24,7 @@ export const ListEmptyUrgentComment = () => ; export const ListNoMoreComments = () => ; +export const ListNoMoreRencontres = () => ; export const ListNoMoreObservations = () => ; export const ListNoMorePersons = () => ; export const ListNoMoreStructures = () => ; diff --git a/app/src/scenes/Reports/Actions.js b/app/src/scenes/Reports/Actions.js index 282683b0d..72c173db1 100644 --- a/app/src/scenes/Reports/Actions.js +++ b/app/src/scenes/Reports/Actions.js @@ -66,7 +66,7 @@ const Actions = ({ route, navigation }) => { }; return ( - + { keyExtractor={keyExtractor} ListEmptyComponent={ListEmptyComponent} onEndReachedThreshold={0.3} - ListFooterComponent={ListNoMoreActions} + ListFooterComponent={actionsToShow.length > 0 ? ListNoMoreActions : null} /> diff --git a/app/src/scenes/Reports/CommentsForReport.js b/app/src/scenes/Reports/CommentsForReport.js index 540f22835..d7b2c6585 100644 --- a/app/src/scenes/Reports/CommentsForReport.js +++ b/app/src/scenes/Reports/CommentsForReport.js @@ -6,7 +6,7 @@ import ScreenTitle from '../../components/ScreenTitle'; import { refreshTriggerState } from '../../components/Loader'; import { FlashListStyled } from '../../components/Lists'; import CommentRow from '../Comments/CommentRow'; -import { ListNoMoreComments } from '../../components/ListEmptyContainer'; +import { ListEmptyComments, ListNoMoreComments } from '../../components/ListEmptyContainer'; import { commentsForReport } from './selectors'; import { getPeriodTitle } from './utils'; import { currentTeamState, organisationState } from '../../recoil/auth'; @@ -105,7 +105,7 @@ const CommentsForReport = ({ navigation, route }) => { }; return ( - + { renderItem={renderItem} keyExtractor={keyExtractor} onEndReachedThreshold={0.3} - ListFooterComponent={ListNoMoreComments} + ListEmptyComponent={ListEmptyComments} + ListFooterComponent={comments.length ? ListNoMoreComments : null} /> ); diff --git a/app/src/scenes/Reports/Observations.js b/app/src/scenes/Reports/Observations.js index a64f14020..eb8587504 100644 --- a/app/src/scenes/Reports/Observations.js +++ b/app/src/scenes/Reports/Observations.js @@ -4,7 +4,7 @@ import SceneContainer from '../../components/SceneContainer'; import ScreenTitle from '../../components/ScreenTitle'; import { refreshTriggerState } from '../../components/Loader'; import { FlashListStyled } from '../../components/Lists'; -import { ListNoMoreObservations } from '../../components/ListEmptyContainer'; +import { ListEmptyObservations, ListNoMoreObservations } from '../../components/ListEmptyContainer'; import { observationsForReport } from './selectors'; import { getPeriodTitle } from './utils'; import { currentTeamState } from '../../recoil/auth'; @@ -45,7 +45,7 @@ const Observations = ({ navigation, route }) => { }; return ( - + { estimatedItemSize={545} keyExtractor={keyExtractor} onEndReachedThreshold={0.3} - ListFooterComponent={ListNoMoreObservations} + ListEmptyComponent={ListEmptyObservations} + ListFooterComponent={observations.length > 0 ? ListNoMoreObservations : null} /> ); diff --git a/app/src/scenes/Reports/RencontresForReport.js b/app/src/scenes/Reports/RencontresForReport.js index b52d62a9f..bb4544efa 100644 --- a/app/src/scenes/Reports/RencontresForReport.js +++ b/app/src/scenes/Reports/RencontresForReport.js @@ -4,7 +4,7 @@ import SceneContainer from '../../components/SceneContainer'; import ScreenTitle from '../../components/ScreenTitle'; import { refreshTriggerState } from '../../components/Loader'; import { FlashListStyled } from '../../components/Lists'; -import { ListNoMoreComments } from '../../components/ListEmptyContainer'; +import { ListEmptyRencontres, ListNoMoreRencontres } from '../../components/ListEmptyContainer'; import { rencontresForReport } from './selectors'; import { getPeriodTitle } from './utils'; import { currentTeamState } from '../../recoil/auth'; @@ -14,6 +14,8 @@ const keyExtractor = (item) => item._id; const RencontresForReport = ({ navigation, route }) => { const date = route?.params?.date; const rencontres = useRecoilValue(rencontresForReport({ date })); + console.log('date', date); + console.log('rencontres', rencontres); const [refreshTrigger, setRefreshTrigger] = useRecoilState(refreshTriggerState); const currentTeam = useRecoilValue(currentTeamState); @@ -32,7 +34,7 @@ const RencontresForReport = ({ navigation, route }) => { }; return ( - + { renderItem={renderItem} keyExtractor={keyExtractor} onEndReachedThreshold={0.3} - ListFooterComponent={ListNoMoreComments} + ListEmptyComponent={ListEmptyRencontres} + ListFooterComponent={rencontres.length > 0 ? ListNoMoreRencontres : null} /> ); diff --git a/app/src/scenes/Reports/Report.js b/app/src/scenes/Reports/Report.js index 1ef504dc4..8e7629526 100644 --- a/app/src/scenes/Reports/Report.js +++ b/app/src/scenes/Reports/Report.js @@ -242,33 +242,33 @@ const Report = ({ navigation, route }) => { navigation.navigate('Actions', { date: reportDB?.date, status: DONE })} + onPress={() => navigation.navigate('Actions', { date: day, status: DONE })} disabled={!actionsCompleted.length} /> navigation.navigate('Actions', { date: reportDB?.date, status: null })} + onPress={() => navigation.navigate('Actions', { date: day, status: null })} disabled={!actionsCreated.length} /> navigation.navigate('Actions', { date: reportDB?.date, status: CANCEL })} + onPress={() => navigation.navigate('Actions', { date: day, status: CANCEL })} disabled={!actionsCanceled.length} /> navigation.navigate('CommentsForReport', { date: reportDB?.date })} + onPress={() => navigation.navigate('CommentsForReport', { date: day })} disabled={!comments.length} /> navigation.navigate('RencontresForReport', { date: reportDB?.date })} + onPress={() => navigation.navigate('RencontresForReport', { date: day })} disabled={!rencontres.length} /> {!!organisation.territoriesEnabled && ( @@ -277,7 +277,7 @@ const Report = ({ navigation, route }) => { navigation.navigate('Observations', { date: reportDB?.date })} + onPress={() => navigation.navigate('Observations', { date: day })} disabled={!observations.length} />