Skip to content

Commit

Permalink
Merge pull request #1100 from prezly/feature/care-4335-do-not-show-ca…
Browse files Browse the repository at this point in the history
…tegories-that-do-not-have-any-stories-in-the

[CARE-4335] Feature - Only show categories that have public stories in the current locale
  • Loading branch information
kudlajz authored Feb 8, 2024
2 parents 664adb2 + dc0374a commit 3052e27
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 47 deletions.
2 changes: 1 addition & 1 deletion modules/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function Header({ localeCode }: Props) {
const categories = await app().categories();
const displayedCategories = await app().translatedCategories(
localeCode,
categories.filter((category) => category.public_stories_number > 0),
categories.filter((category) => category.i18n[localeCode]?.public_stories_number > 0),
);

const algoliaSettings =
Expand Down
1 change: 1 addition & 0 deletions modules/Search/components/Hit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function Hit({ hit }: Props) {
name,
slug,
description: null,
public_stories_number: 0, // We do not have access to number of stories from Algolia
}))
.filter((category) => Boolean(category.slug)),
[localeCode, categories],
Expand Down
88 changes: 44 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"@playwright/test": "^1.33.0",
"@prezly/analytics-nextjs": "1.13.0",
"@prezly/content-renderer-react-js": "0.34.1",
"@prezly/sdk": "19.7.0",
"@prezly/sdk": "19.10.0",
"@prezly/story-content-format": "0.64.0",
"@prezly/theme-kit-nextjs": "8.1.0",
"@prezly/theme-kit-nextjs": "8.2.0",
"@prezly/uploadcare": "2.4.3",
"@prezly/uploadcare-image": "0.3.2",
"@react-hookz/web": "14.7.1",
Expand Down

0 comments on commit 3052e27

Please sign in to comment.