Skip to content

Commit

Permalink
added pagination to tonies page
Browse files Browse the repository at this point in the history
  • Loading branch information
henryk86 committed May 1, 2024
1 parent 54cea33 commit 18ac5ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion public/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"tonies": {
"navigationTitle": "Tonies",
"title": "Tonies",
"pageSelector": " Tonies / Seite",
"tonies": {
"navigationTitle": "Tonies",
"title": "Tonies"
Expand Down Expand Up @@ -81,7 +82,7 @@
"cloudAccessEnabled": "Cloud-Zugang aktiviert!",
"couldNotChangeCloudFlag": "Konnte Cloud-Zugriff (nocloud) Flag nicht ändern! ",
"downloading": "Herunterladen...",
"downloadedFile": "Heruntergeladene Datei",
"downloadedFile": "Datei heruntergeladen",
"errorDuringDownload": "Fehler beim Herunterladen im Hintergrund: ",
"setTonieToModelSuccessful": "Setze Tonie-Modell auf {{selectedModel}}!",
"setTonieToModelFailed": "Konnte das Tonie-Modell nicht ändern!"
Expand Down
1 change: 1 addition & 0 deletions public/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"tonies": {
"navigationTitle": "Tonies",
"title": "Tonies",
"pageSelector": " tonies / page",
"tonies": {
"navigationTitle": "Tonies",
"title": "Tonies"
Expand Down
18 changes: 13 additions & 5 deletions src/components/tonies/ToniesList.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@

import { List } from 'antd';
import { useTranslation } from 'react-i18next'; // Assuming you are using react-i18next for translation
import { TonieCard, TonieCardProps } from '../../components/tonies/TonieCard';

export const ToniesList: React.FC<{ tonieCards: TonieCardProps[] }> = ({ tonieCards }) => {

const { t } = useTranslation();

return (
<List

grid={{
gutter: 16,
xs: 1,
sm: 2,
md: 2,
lg: 3,
xl: 4,
xxl: 6,
xxl: 6
}}

pagination={{
showSizeChanger: true,
hideOnSinglePage: true,
pageSizeOptions: ["10", "50", "100", "1000"],
position: "both"
defaultPageSize: 24,
pageSizeOptions: ["24", "48", "96", "192"],
position: "both",
style: { "marginBottom": "16px" },
locale: {
items_per_page: t('tonies.pageSelector'), // Custom text for page size selector
}
}}

dataSource={tonieCards}
Expand Down

0 comments on commit 18ac5ec

Please sign in to comment.