aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/posts-list.fixture.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-13 17:45:59 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-13 17:45:59 +0100
commit56878f647ea0f1066fa3e222d7aa0d83057f496d (patch)
tree26f673a062741414bfa7db5d37990936ce115f49 /src/components/organisms/layout/posts-list.fixture.tsx
parent599b70cd2390d08ce26ee44174b3f39c6587110c (diff)
refactor(components): rewrite PostsList component
* remove NoResults component and move logic to Search page * add a usePostsList hook * remove Pagination from PostsList (it is only used if javascript is disabled and not on every posts list) * replace `byYear` prop with `sortByYear` * replace `loadMore` prop with `onLoadMore` * remove `showLoadMoreBtn` (we can use `loadMore` prop instead to determine if we need to display the button) * replace `titleLevel` prop with `headingLvl` * add `firstNewResult` prop to handle focus on the new results when loading more article (we should not focus a useless span but the item directly)
Diffstat (limited to 'src/components/organisms/layout/posts-list.fixture.tsx')
-rw-r--r--src/components/organisms/layout/posts-list.fixture.tsx62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/components/organisms/layout/posts-list.fixture.tsx b/src/components/organisms/layout/posts-list.fixture.tsx
deleted file mode 100644
index e1f7a95..0000000
--- a/src/components/organisms/layout/posts-list.fixture.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import NextImage from 'next/image';
-import type { PostData } from './posts-list';
-
-export const introPost1 =
- 'Esse et voluptas sapiente modi impedit unde et. Ducimus nulla ea impedit sit placeat nihil assumenda. Rem est fugiat amet quo hic. Corrupti fuga quod animi autem dolorem ullam corrupti vel aut.';
-
-export const introPost2 =
- 'Illum quae asperiores quod aut necessitatibus itaque excepturi voluptas. Incidunt exercitationem ullam saepe alias consequatur sed. Quam veniam quaerat voluptatum earum quia quisquam fugiat sed perspiciatis. Et velit saepe est recusandae facilis eos eum ipsum.';
-
-export const introPost3 =
- 'Sunt aperiam ut rem impedit dolor id sit. Reprehenderit ipsum iusto fugiat. Quaerat laboriosam magnam facilis. Totam sint aliquam voluptatem in quis laborum sunt eum. Enim aut debitis officiis porro iure quia nihil voluptas ipsum. Praesentium quis necessitatibus cumque quia qui velit quos dolorem.';
-
-export const cover = {
- alt: 'cover',
- height: 480,
- src: 'http://picsum.photos/640/480',
- width: 640,
-};
-
-export const posts: PostData[] = [
- {
- cover: <NextImage {...cover} />,
- excerpt: introPost1,
- id: 'post-1',
- meta: {
- publicationDate: '2022-02-26',
- wordsCount: introPost1.split(' ').length,
- thematics: [
- { id: 1, name: 'Cat 1', url: '#' },
- { id: 2, name: 'Cat 2', url: '#' },
- ],
- comments: { count: 1, postHeading: 'Ratione velit fuga' },
- },
- heading: 'Ratione velit fuga',
- url: '#',
- },
- {
- excerpt: introPost2,
- id: 'post-2',
- meta: {
- publicationDate: '2022-02-20',
- wordsCount: introPost2.split(' ').length,
- thematics: [{ id: 2, name: 'Cat 2', url: '#' }],
- comments: { count: 0, postHeading: 'Debitis laudantium laudantium' },
- },
- heading: 'Debitis laudantium laudantium',
- url: '#',
- },
- {
- cover: <NextImage {...cover} />,
- excerpt: introPost3,
- id: 'post-3',
- meta: {
- publicationDate: '2021-12-20',
- wordsCount: introPost3.split(' ').length,
- thematics: [{ id: 1, name: 'Cat 1', url: '#' }],
- comments: { count: 3, postHeading: 'Quaerat ut corporis' },
- },
- heading: 'Quaerat ut corporis',
- url: '#',
- },
-];