Skip to content

Commit

Permalink
fix feedback ui (line-clamp, pagination ...) (#1089)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpasquet committed Apr 10, 2024
1 parent 82223ef commit 6691ab1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 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.34.0",
"@eleven-labs/design-system": "^0.35.0",
"@remix-run/router": "^1.7.2",
"algoliasearch": "^4.19.1",
"classnames": "^2.3.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SearchPageContentProps } from '@eleven-labs/design-system';
import { useLink } from 'hoofd';
import { useLink, useTitleTemplate } from 'hoofd';
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';

Expand All @@ -16,13 +16,14 @@ export const useSearchPageContentContainer = (): SearchPageContentProps => {
const { t, i18n } = useTranslation();
const [isLoading, setIsLoading] = useState<boolean>(true);
const algoliaSearchIndex = useAlgoliaSearchIndex();
useTitle(t('pages.search.seo.title'));
const search = new URLSearchParams(!IS_SSR ? window.location.search : '').get('search') || '';
useTitleTemplate('Blog Eleven Labs - %s');
useTitle(t('pages.search.seo.title', { search }));
useLink({
rel: 'canonical',
href: `${blogUrl}${generatePath(PATHS.SEARCH, { lang: DEFAULT_LANGUAGE })}`,
});

const search = new URLSearchParams(!IS_SSR ? window.location.search : '').get('search') || '';
const [postsBySearch, setPostsBySearch] = useState<PostCardListContainerProps['allPosts']>([]);

useEffect(() => {
Expand Down Expand Up @@ -55,7 +56,13 @@ export const useSearchPageContentContainer = (): SearchPageContentProps => {
}, [search, i18n.language]); // eslint-disable-line react-hooks/exhaustive-deps

return {
title: <TransWithHtml i18nKey="pages.search.title" values={{ numberOfHits: postsBySearch.length }} onlyLineBreak />,
title: (
<TransWithHtml
i18nKey="pages.search.title"
values={{ numberOfHits: postsBySearch.length, search }}
onlyLineBreak
/>
),
description: <TransWithHtml i18nKey="pages.search.description" />,
searchNotFound:
postsBySearch?.length === 0
Expand Down
7 changes: 5 additions & 2 deletions src/translations/en.translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,11 @@
"post_list_title": "Articles and tutorials by the author"
},
"search": {
"title": "{{ numberOfHits }} results",
"description": "sorted by relevance"
"title": "{{ numberOfHits }} results for \"{{ search }}\"",
"description": "sorted by relevance",
"seo": {
"title": "Articles for “{{ search }}”"
}
},
"not-found": {
"title": "Page not found"
Expand Down
7 changes: 5 additions & 2 deletions src/translations/fr.translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,11 @@
"post_list_title": "Articles et tutoriels écrits par l'auteur"
},
"search": {
"title": "{{ numberOfHits }} résultats",
"description": "triés par pertinence"
"title": "{{ numberOfHits }} résultats pour \"{{ search }}\"",
"description": "triés par pertinence",
"seo": {
"title": "Articles pour “{{ search }}”"
}
},
"not-found": {
"title": "Page non trouvée"
Expand Down

0 comments on commit 6691ab1

Please sign in to comment.