Skip to content

Commit

Permalink
fix: upgrade design system and fix breadcrumb (#1093)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpasquet authored Apr 14, 2024
1 parent 04cb76e commit ea996d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"node": ">= 20.0"
},
"dependencies": {
"@eleven-labs/design-system": "^0.35.0",
"@eleven-labs/design-system": "^0.36.0",
"@remix-run/router": "^1.7.2",
"algoliasearch": "^4.19.1",
"classnames": "^2.3.2",
Expand Down
5 changes: 4 additions & 1 deletion src/hooks/useBreadcrumb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { PATHS } from '@/constants';
import { generatePath } from '@/helpers/routerHelper';

export const useBreadcrumb = (options: { categoryName?: string }): BreadcrumbProps => {
export const useBreadcrumb = (options: { categoryName?: string; withCategoryLink?: boolean }): BreadcrumbProps => {
const { t, i18n } = useTranslation();
return {
items: [
Expand All @@ -14,6 +14,9 @@ export const useBreadcrumb = (options: { categoryName?: string }): BreadcrumbPro
},
{
label: t(`common.categories.${options.categoryName ?? 'all'}`),
href: options.withCategoryLink
? generatePath(PATHS.CATEGORY, { lang: i18n.language, categoryName: options.categoryName ?? 'all' })
: undefined,
},
],
};
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/usePostPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const usePostPage = (post: PostPageData): Omit<PostPageProps, 'variant' |
}, []);

const contactCard = useContactCard();
const breadcrumb = useBreadcrumb({ categoryName: post.categories[0] });
const breadcrumb = useBreadcrumb({ categoryName: post.categories[0], withCategoryLink: true });
const relatedPostsForCardList = usePostsForCardList({
posts: post.relatedPosts,
imageFormatEnum: ImageFormatEnum.POST_CARD_COVER,
Expand Down

0 comments on commit ea996d0

Please sign in to comment.