From 8070f37c9c70e257b717ac80a7a405159f2408e4 Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Mon, 5 Aug 2024 15:07:28 +0200 Subject: [PATCH 1/2] Refactor `.content-list-page__subheading` - Refactor the class to follow the design: [Figma Design System](https://www.figma.com/design/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=7573-84899&t=uXZ303kl02THWEMQ-4) I began refactoring the search results and other lists to use the `content-list-page` system we developed for lists in Drupal, aiming for a consistent design. The task turned out to be more extensive than expected, so I suggest handling it in a separate ticket/pull request. - added some "TODO" items for future reference. - Remove the unnecessary css files --- base.scss | 2 -- src/stories/Blocks/content-list-page/ContentListPage.tsx | 4 ++++ .../Blocks/content-list-page/content-list-page.scss | 7 +++++-- src/stories/Blocks/favorites-list/FavoritesList.tsx | 1 + src/stories/Library/card-list-page/SearchResultInfo.tsx | 3 ++- src/stories/Library/card-list-page/SearchResultTitle.tsx | 1 + src/stories/Library/card-list-page/search-result-info.scss | 4 ---- .../Library/card-list-page/search-result-title.scss | 4 ---- 8 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 src/stories/Library/card-list-page/search-result-info.scss delete mode 100644 src/stories/Library/card-list-page/search-result-title.scss diff --git a/base.scss b/base.scss index 966550281..9cef519f0 100644 --- a/base.scss +++ b/base.scss @@ -69,7 +69,6 @@ @import "./src/stories/Library/material-description/material-description"; @import "./src/stories/Library/disclosure/disclosure"; @import "./src/stories/Library/horizontal-term-line/horizontal-term-line"; -@import "./src/stories/Library/card-list-page/search-result-info"; @import "./src/stories/Library/card-list-page/card-list-page"; @import "./src/stories/Library/card-list-page/card-list-page-skeleton"; @import "./src/stories/Library/loan-list-page/loan-list-page"; @@ -77,7 +76,6 @@ @import "./src/stories/Library/patron-page/patron-page"; @import "./src/stories/Library/reservation-list-page/reservation-list-page"; @import "./src/stories/Library/card-list-page/result-pager"; -@import "./src/stories/Library/card-list-page/search-result-title"; @import "./src/stories/Library/card-list-page/search-result-zero"; @import "./src/stories/Library/card-list-page/facet-line"; @import "./src/stories/Library/review/review"; diff --git a/src/stories/Blocks/content-list-page/ContentListPage.tsx b/src/stories/Blocks/content-list-page/ContentListPage.tsx index 955fab030..c8a53fc4a 100644 --- a/src/stories/Blocks/content-list-page/ContentListPage.tsx +++ b/src/stories/Blocks/content-list-page/ContentListPage.tsx @@ -37,6 +37,10 @@ const ContentListPage: React.FC = () => { return (

Arrangementer

+

+ Switch to results for the  + library materials. +

{filters.map((filter) => { return ( diff --git a/src/stories/Blocks/content-list-page/content-list-page.scss b/src/stories/Blocks/content-list-page/content-list-page.scss index 1c5f2a70f..a0e683d7d 100644 --- a/src/stories/Blocks/content-list-page/content-list-page.scss +++ b/src/stories/Blocks/content-list-page/content-list-page.scss @@ -9,11 +9,14 @@ } .content-list-page__subheading { - @extend %rich-text; - @include layout-container($block-max-width__large); @include typography($typo__body-small); + color: $color__global-grey; margin-top: $s-lg; + + a { + @include link-tag; + } } .content-list-page__filters { diff --git a/src/stories/Blocks/favorites-list/FavoritesList.tsx b/src/stories/Blocks/favorites-list/FavoritesList.tsx index 5a1528c7f..a8506c461 100644 --- a/src/stories/Blocks/favorites-list/FavoritesList.tsx +++ b/src/stories/Blocks/favorites-list/FavoritesList.tsx @@ -13,6 +13,7 @@ const FavouritesList: React.FC = ({ skeletonVersion = false, materialsCount, }) => { + // Todo: use content-list-page__heading and content-list-page__subheading const pageTitle = (

Favourites

); diff --git a/src/stories/Library/card-list-page/SearchResultInfo.tsx b/src/stories/Library/card-list-page/SearchResultInfo.tsx index fa2960b82..01c2bdfde 100644 --- a/src/stories/Library/card-list-page/SearchResultInfo.tsx +++ b/src/stories/Library/card-list-page/SearchResultInfo.tsx @@ -8,7 +8,8 @@ export const SearchResultInfo = ({ linkTotalResults, }: SearchResultInfoProps) => { return ( -

+ // Todo: use content-list-page__heading +

Vis i stedet resultater fra{" "} {linkName} diff --git a/src/stories/Library/card-list-page/SearchResultTitle.tsx b/src/stories/Library/card-list-page/SearchResultTitle.tsx index e160a7824..21ce01504 100644 --- a/src/stories/Library/card-list-page/SearchResultTitle.tsx +++ b/src/stories/Library/card-list-page/SearchResultTitle.tsx @@ -13,6 +13,7 @@ export const SearchResultTitle = ({ zeroResult, isLoading = false, }: SearchResultTitleProps) => { + // Todo: use content-list-page__heading const classes = clsx(["text-header-h2", "mb-16", "search-result-title"], { "text-loading": isLoading, }); diff --git a/src/stories/Library/card-list-page/search-result-info.scss b/src/stories/Library/card-list-page/search-result-info.scss deleted file mode 100644 index ca2bf10ec..000000000 --- a/src/stories/Library/card-list-page/search-result-info.scss +++ /dev/null @@ -1,4 +0,0 @@ -/* This is a placeholder file for future styling */ -/* stylelint-disable block-no-empty */ -.search-result-info { -} diff --git a/src/stories/Library/card-list-page/search-result-title.scss b/src/stories/Library/card-list-page/search-result-title.scss deleted file mode 100644 index 2b4d06d48..000000000 --- a/src/stories/Library/card-list-page/search-result-title.scss +++ /dev/null @@ -1,4 +0,0 @@ -/* This is a placeholder file for future styling */ -/* stylelint-disable block-no-empty */ -.search-result-title { -} From e1c13f9e3d60310f2ecd895061fa17fcf4c41524 Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Wed, 14 Aug 2024 15:33:29 +0200 Subject: [PATCH 2/2] Integrate `.content-list-page` and its sub-elements for react list. Ensure consistent list styling between the Drupal CMS and React applications --- base.scss | 1 - .../Blocks/advanced-search/AdvancedSearch.tsx | 20 +++++++++------- .../content-list-page/ContentListPage.tsx | 8 +++---- .../content-list-page/content-list-page.scss | 1 + .../Blocks/favorites-list/FavoritesList.tsx | 23 ++++++++---------- .../card-list-item/card-list-item.scss | 1 + .../card-list-page/SearchResultInfo.tsx | 3 +-- .../card-list-page/SearchResultPage.tsx | 10 +++++--- .../SearchResultPageSkeleton.tsx | 24 ++++++------------- .../card-list-page/SearchResultTitle.tsx | 3 +-- .../card-list-page-skeleton.scss | 2 ++ .../card-list-page/card-list-page.scss | 13 ---------- .../Library/card-list-page/facet-line.scss | 10 ++++---- .../Library/content-list/content-list.scss | 2 ++ 14 files changed, 52 insertions(+), 69 deletions(-) delete mode 100644 src/stories/Library/card-list-page/card-list-page.scss diff --git a/base.scss b/base.scss index 9cef519f0..b3acf30d5 100644 --- a/base.scss +++ b/base.scss @@ -69,7 +69,6 @@ @import "./src/stories/Library/material-description/material-description"; @import "./src/stories/Library/disclosure/disclosure"; @import "./src/stories/Library/horizontal-term-line/horizontal-term-line"; -@import "./src/stories/Library/card-list-page/card-list-page"; @import "./src/stories/Library/card-list-page/card-list-page-skeleton"; @import "./src/stories/Library/loan-list-page/loan-list-page"; @import "./src/stories/Library/dashboard-page/dashboard-page"; diff --git a/src/stories/Blocks/advanced-search/AdvancedSearch.tsx b/src/stories/Blocks/advanced-search/AdvancedSearch.tsx index 8d24e19f2..e4014d68b 100644 --- a/src/stories/Blocks/advanced-search/AdvancedSearch.tsx +++ b/src/stories/Blocks/advanced-search/AdvancedSearch.tsx @@ -119,16 +119,20 @@ export const AdvancedSearch: React.FC = ({ />
-
-

- Viser materialer (20) -

- -
+
+

Viser materialer (20)

+
+ +
+
    {data.searchResult.map((item, i) => { - return ; + return ( +
  • + +
  • + ); })} -
+
diff --git a/src/stories/Blocks/content-list-page/ContentListPage.tsx b/src/stories/Blocks/content-list-page/ContentListPage.tsx index c8a53fc4a..fa72882ff 100644 --- a/src/stories/Blocks/content-list-page/ContentListPage.tsx +++ b/src/stories/Blocks/content-list-page/ContentListPage.tsx @@ -41,20 +41,20 @@ const ContentListPage: React.FC = () => { Switch to results for the 
library materials.

-
+
    {filters.map((filter) => { return ( -
    +
  • -
  • + ); })} -
+
); diff --git a/src/stories/Blocks/content-list-page/content-list-page.scss b/src/stories/Blocks/content-list-page/content-list-page.scss index a0e683d7d..6b9c05bed 100644 --- a/src/stories/Blocks/content-list-page/content-list-page.scss +++ b/src/stories/Blocks/content-list-page/content-list-page.scss @@ -19,6 +19,7 @@ } } +// Todo should be merged with .facet-line .content-list-page__filters { @include layout-container($block-max-width__large); diff --git a/src/stories/Blocks/favorites-list/FavoritesList.tsx b/src/stories/Blocks/favorites-list/FavoritesList.tsx index a8506c461..7931520be 100644 --- a/src/stories/Blocks/favorites-list/FavoritesList.tsx +++ b/src/stories/Blocks/favorites-list/FavoritesList.tsx @@ -13,19 +13,16 @@ const FavouritesList: React.FC = ({ skeletonVersion = false, materialsCount, }) => { - // Todo: use content-list-page__heading and content-list-page__subheading - const pageTitle = ( -

Favourites

- ); - const materialsCountLine = materialsCount > 0 && ( -

{materialsCount} materials

+

+ {materialsCount} materials +

); const SkeletonList = () => ( -