diff --git a/src/components/PaginationNav/PaginationNav.tsx b/src/components/PaginationNav/PaginationNav.tsx new file mode 100644 index 000000000..b55c87e8f --- /dev/null +++ b/src/components/PaginationNav/PaginationNav.tsx @@ -0,0 +1,36 @@ +import React from 'react'; + +import type { SelectChangeEvent } from '@mui/material'; +import { InputLabel, MenuItem, Pagination, Select, Stack } from '@mui/material'; + +interface PaginationNavProps { + page: number; + itemsPerPage: number; + totalItems: number; + handlePage: (_: React.ChangeEvent, value: number) => void; + handleItemsPerPage: (e: SelectChangeEvent) => void; +} + +const PaginationNav = ({ page, itemsPerPage, totalItems, handlePage, handleItemsPerPage }: PaginationNavProps) => { + return ( + + + Activités par page + + + {totalItems > itemsPerPage && } + + ); +}; +export default PaginationNav; diff --git a/src/components/activities/List.tsx b/src/components/activities/List.tsx index 804e47183..3d54c76ee 100644 --- a/src/components/activities/List.tsx +++ b/src/components/activities/List.tsx @@ -2,7 +2,9 @@ import React, { useState } from 'react'; import type { SelectChangeEvent } from '@mui/material'; import { InputLabel, Button, MenuItem, Pagination, Select, Stack } from '@mui/material'; +import { margin } from '@mui/system'; +import PaginationNav from '../PaginationNav/PaginationNav'; import { ActivityCard } from './ActivityCard'; import { isAnthem } from 'src/activity-types/anyActivity'; import { UserContext } from 'src/contexts/userContext'; @@ -161,26 +163,13 @@ export const Activities = ({ activities, noButtons = false, withLinks = false, w return card; })} {withPagination && ( - + )} );