Skip to content

Commit

Permalink
Fixed page limit in list paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Feb 18, 2025
1 parent c3bb21b commit 28dd722
Show file tree
Hide file tree
Showing 4 changed files with 538 additions and 557 deletions.
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"dependencies": {
"@heroicons/react": "^2.2.0",
"@mui/base": "5.0.0-beta.69",
"@next/third-parties": "15.1.6",
"@next/third-parties": "15.1.7",
"@tailwindcss/container-queries": "^0.1.1",
"@types/node": "22.13.1",
"@types/react": "19.0.8",
"@types/react-dom": "19.0.3",
"algoliasearch": "^5.20.0",
"@types/node": "22.13.4",
"@types/react": "19.0.10",
"@types/react-dom": "19.0.4",
"algoliasearch": "^5.20.3",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"decanter": "^7.3.1",
Expand All @@ -31,13 +31,13 @@
"graphql-tag": "^2.12.6",
"html-entities": "^2.5.2",
"html-react-parser": "^5.2.2",
"next": "^15.2.0-canary.39",
"next": "^15.2.0-canary.64",
"plaiceholder": "^3.0.0",
"postcss": "^8.5.1",
"postcss": "^8.5.2",
"qs": "^6.14.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-focus-lock": "^2.13.5",
"react-focus-lock": "^2.13.6",
"react-instantsearch": "^7.15.3",
"react-instantsearch-nextjs": "^0.4.4",
"react-slick": "^0.30.3",
Expand All @@ -47,40 +47,40 @@
"tailwind-merge": "^2.6.0",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"usehooks-ts": "^3.1.0"
"usehooks-ts": "^3.1.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.19.0",
"@eslint/js": "^9.20.0",
"@graphql-codegen/add": "^5.0.3",
"@graphql-codegen/cli": "^5.0.4",
"@graphql-codegen/cli": "^5.0.5",
"@graphql-codegen/import-types-preset": "^3.0.0",
"@graphql-codegen/typescript-graphql-request": "^6.2.0",
"@graphql-codegen/typescript-operations": "^4.4.1",
"@next/bundle-analyzer": "15.1.6",
"@storybook/addon-essentials": "^8.5.2",
"@storybook/addon-interactions": "^8.5.3",
"@storybook/addon-links": "^8.5.3",
"@next/bundle-analyzer": "15.1.7",
"@storybook/addon-essentials": "^8.5.7",
"@storybook/addon-interactions": "^8.5.7",
"@storybook/addon-links": "^8.5.7",
"@storybook/addon-styling": "^1.3.7",
"@storybook/blocks": "^8.5.3",
"@storybook/nextjs": "^8.5.3",
"@storybook/react": "^8.5.3",
"@storybook/blocks": "^8.5.7",
"@storybook/nextjs": "^8.5.7",
"@storybook/react": "^8.5.7",
"@storybook/testing-library": "^0.2.2",
"@types/react-slick": "^0.23.13",
"concurrently": "^9.1.2",
"encoding": "^0.1.13",
"eslint": "^9.19.0",
"eslint-config-next": "15.1.6",
"eslint": "^9.20.1",
"eslint-config-next": "15.1.7",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-storybook": "^0.11.2",
"prettier": "^3.4.2",
"eslint-plugin-storybook": "^0.11.3",
"prettier": "^3.5.1",
"prettier-plugin-tailwindcss": "^0.6.11",
"react-docgen": "^7.1.1",
"storybook": "^8.5.3",
"storybook": "^8.5.7",
"storybook-addon-module-mock": "^1.3.4",
"tsconfig-paths-webpack-plugin": "^4.2.0",
"typescript-eslint": "^8.23.0"
"typescript-eslint": "^8.24.1"
},
"packageManager": "[email protected]",
"resolutions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ListParagraph = async ({paragraph, ...props}: Props) => {
: {items: [], totalItems: 0}

const {totalItems} = pagedItems
const viewItems = limit ? pagedItems.items.slice(0, limit) : pagedItems.items
const viewItems = limit ? pagedItems.items.slice(0, VIEW_PAGE_SIZE) : pagedItems.items

const addLoadMore = (limit || 3) >= VIEW_PAGE_SIZE && totalItems > viewItems.length

Expand Down
1 change: 1 addition & 0 deletions src/lib/gql/gql-views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export const getViewPagedItems = async (
if (e instanceof Error) console.warn(e.message)
return {items: [], totalItems: 0}
}

return {items, totalItems}
}

Expand Down
Loading

0 comments on commit 28dd722

Please sign in to comment.