Skip to content

Commit

Permalink
feat: [#216] [Join NGO] Receive join request answer: Org update tile …
Browse files Browse the repository at this point in the history
…is not displayed on Home page (#320)
  • Loading branch information
radulescuandrew authored Jul 22, 2024
1 parent 03da622 commit 71feee8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ export class GetVolunteerMonthlyNewsStatisticsUsecase
await this.actionsArchiveFacade.countDocumentStatusUpdatesBetweenDates(
volunteerIds,
);
// get number of organization access requests
statisticsResponse.numberOfOrganizationUpdates =
await this.actionsArchiveFacade.countActivityRequestsUpdatesBetweenDates(
user.id,
);
}
// get number of organization access requests
statisticsResponse.numberOfOrganizationUpdates =
await this.actionsArchiveFacade.countActivityRequestsUpdatesBetweenDates(
user.id,
);

return statisticsResponse;
}
Expand Down
20 changes: 11 additions & 9 deletions mobile/src/components/Statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const Statistics = ({ navigation }: { navigation: any }) => {
backgroundColor="color-primary-50"
onPress={onEventsCardPress}
/>

{userProfile?.activeOrganization && (
<>
<StatisticsCard
Expand All @@ -89,17 +90,18 @@ const Statistics = ({ navigation }: { navigation: any }) => {
backgroundColor="color-primary-50"
onPress={onDocumentsCardPress}
/>
<StatisticsCard
icon="users"
title={`${t('statistics.organizations.title', {
number: statistics?.numberOfOrganizationUpdates,
})}`}
subtitle={t('statistics.organizations.description')}
backgroundColor="color-primary-50"
onPress={onOrganizationsCardPress}
/>
</>
)}

<StatisticsCard
icon="users"
title={`${t('statistics.organizations.title', {
number: statistics?.numberOfOrganizationUpdates,
})}`}
subtitle={t('statistics.organizations.description')}
backgroundColor="color-primary-50"
onPress={onOrganizationsCardPress}
/>
</HorizontalCarousel>
)}
</SectionWrapper>
Expand Down
5 changes: 4 additions & 1 deletion mobile/src/screens/News.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ const News = ({ navigation, route }: any) => {
const activeOrganization = userProfile?.myOrganizations.find(
(org) => org.id === item.organizationId,
);
setActiveOrganization(activeOrganization as IOrganizationVolunteer);

if (activeOrganization) {
setActiveOrganization(activeOrganization as IOrganizationVolunteer);
}
switchOrganization({ organizationId: item.organizationId as string });

if (type === NewsType.LOGGED_HOURS) {
Expand Down

0 comments on commit 71feee8

Please sign in to comment.