Skip to content

Commit

Permalink
Merge pull request #1736 from BLSQ/POLIO-1706-Campaigns-Users-cannot-…
Browse files Browse the repository at this point in the history
…filter-by-campaign-type

POLIO-1706: Campaigns: Users cannot filter by campaign type
  • Loading branch information
hakifran authored Oct 24, 2024
2 parents c8142a9 + ff42903 commit 1bc35be
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box } from '@mui/material';
import { useSafeIntl } from 'bluesquare-components';
import React, { FunctionComponent, useMemo } from 'react';
import React, { FunctionComponent, useMemo, useState } from 'react';
import TopBar from '../../../../../../../hat/assets/js/apps/Iaso/components/nav/TopBarComponent';
import { TableWithDeepLink } from '../../../../../../../hat/assets/js/apps/Iaso/components/tables/TableWithDeepLink';
import MESSAGES from '../../../constants/messages';
Expand Down Expand Up @@ -28,7 +28,7 @@ export const Dashboard: FunctionComponent = () => {
const classes: Record<string, string> = useStyles();
const paramsToUse = useActiveParams(params);
const apiParams: GetCampaignOptions = useCampaignParams(paramsToUse);

const [campaignType, setCampaignType] = useState(params.campaignType);
const { data: rawCampaigns, isFetching } = useGetCampaigns(
apiParams,
undefined,
Expand Down Expand Up @@ -70,14 +70,19 @@ export const Dashboard: FunctionComponent = () => {
handleClickRestoreRow: handleRestoreDialogConfirm,
params,
});

return (
<>
<TopBar
title={formatMessage(MESSAGES.campaigns)}
displayBackButton={false}
/>
<Box className={classes.containerFullHeightNoTabPadded}>
<CampaignsFilters params={params} />
<CampaignsFilters
params={params}
setCampaignType={setCampaignType}
campaignType={campaignType}
/>
<Box mb={2}>
<DashboardButtons exportToCSV={exportToCSV} />
</Box>
Expand Down

0 comments on commit 1bc35be

Please sign in to comment.