Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tan 3369/remove menu instances: pagination #9797

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions front/app/components/admin/Email/RecipientsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';

import { StatusLabel, colors } from '@citizenlab/cl2-component-library';
import { Box, StatusLabel, colors } from '@citizenlab/cl2-component-library';

import { IDeliveryData } from 'api/campaign_deliveries/types';
import useUserById from 'api/users/useUserById';

import Pagination from 'components/admin/Pagination';
import { List, Row, TextCell } from 'components/admin/ResourceList';
import Avatar from 'components/Avatar';
import Pagination from 'components/Pagination';

import { FormattedMessage } from 'utils/cl-intl';
import { isNilOrError } from 'utils/helperUtils';
Expand Down Expand Up @@ -80,20 +80,24 @@ const RecipientsTable = ({
}

return (
<List className={className} key={deliveries.map((d) => d.id).join()}>
{deliveries.map((recipient) => (
<TableRow
recipient={recipient}
userId={recipient.relationships.user.data.id}
key={recipient.id}
/>
))}
<>
<Box mb="24px">
<List className={className} key={deliveries.map((d) => d.id).join()}>
{deliveries.map((recipient) => (
<TableRow
recipient={recipient}
userId={recipient.relationships.user.data.id}
key={recipient.id}
/>
))}
</List>
</Box>
<Pagination
currentPage={currentPage}
totalPages={lastPage}
loadPage={onChangePage}
/>
</List>
</>
);
};

Expand Down
69 changes: 0 additions & 69 deletions front/app/components/admin/Pagination/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { IIdeaStatusData } from 'api/idea_statuses/types';
import { Sort as IdeasSort, IIdeaData } from 'api/ideas/types';
import { IPhaseData } from 'api/phases/types';

import Pagination from 'components/admin/Pagination';
import Pagination from 'components/Pagination';

import { SortDirection } from 'utils/paginationUtils';

Expand Down
2 changes: 1 addition & 1 deletion front/app/containers/Admin/invitations/all/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import useInvites from 'api/invites/useInvites';

import { API_PATH } from 'containers/App/constants';

import Pagination from 'components/admin/Pagination';
import Pagination from 'components/Pagination';
import Button from 'components/UI/Button';
import SearchInput from 'components/UI/SearchInput';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { isDraft } from 'api/campaigns/util';
import DraftCampaignRow from 'components/admin/Email/DraftCampaignRow';
import SentCampaignRow from 'components/admin/Email/SentCampaignRow';
import { ButtonWrapper } from 'components/admin/PageWrapper';
import Pagination from 'components/admin/Pagination';
import Pagination from 'components/Pagination';
import { List } from 'components/admin/ResourceList';

import { FormattedMessage } from 'utils/cl-intl';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { isDraft } from 'api/campaigns/util';
import DraftCampaignRow from 'components/admin/Email/DraftCampaignRow';
import SentCampaignRow from 'components/admin/Email/SentCampaignRow';
import { ButtonWrapper } from 'components/admin/PageWrapper';
import Pagination from 'components/admin/Pagination';
import Pagination from 'components/Pagination';
import { List } from 'components/admin/ResourceList';

import { FormattedMessage } from 'utils/cl-intl';
Expand Down