diff --git a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.html b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.html index 84a67f4358..a42bda0674 100644 --- a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.html +++ b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.html @@ -5,14 +5,16 @@ @if((viewMode$ | async) === ViewMode.ListElement) { - @for (result of loadingResults; track result) { -
+ @for (result of loadingResults; track result; let first = $first) { +
@if(showThumbnails) { -
- +
+
+ +
} -
+
diff --git a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.scss b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.scss index e05e4be6d8..9345f1ab43 100644 --- a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.scss +++ b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.scss @@ -20,12 +20,13 @@ } .thumbnail-skeleton { + max-width: var(--ds-thumbnail-max-width); + height: 100%; + ngx-skeleton-loader .skeleton-loader { - width: var(--ds-search-skeleton-thumbnail-width); - height: var(--ds-search-skeleton-thumbnail-height); - padding: var(--ds-search-skeleton-thumbnail-padding); margin-right: var(--ds-search-skeleton-thumbnail-margin); border-radius: 0; + height: 100%; } } @@ -52,8 +53,4 @@ } } -.result-row { - margin-right: 0; - margin-left: 0; -} diff --git a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts index 16df026cfd..3fba70b119 100644 --- a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts +++ b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts @@ -29,17 +29,28 @@ import { hasValue } from '../../../empty.util'; * Component to show placeholders for search results while loading, to give a loading feedback to the user without layout shifting. */ export class SearchResultsSkeletonComponent implements OnInit { + /** + * Whether the search result contains thumbnail + */ @Input() showThumbnails: boolean; - + /** + * The number of search result loaded in the current page + */ @Input() numberOfResults = 0; - + /** + * How many placeholder are displayed for the search result text + */ @Input() textLineCount = 2; - + /** + * The view mode of the search page + */ public viewMode$: Observable; - + /** + * Array built from numberOfResults to count and iterate based on index + */ public loadingResults: number[]; protected readonly ViewMode = ViewMode; diff --git a/src/styles/_custom_variables.scss b/src/styles/_custom_variables.scss index d47f5d2dfa..3c3244549e 100644 --- a/src/styles/_custom_variables.scss +++ b/src/styles/_custom_variables.scss @@ -141,9 +141,6 @@ --ds-search-skeleton-text-height: 20px; --ds-search-skeleton-badge-height: 18px; - --ds-search-skeleton-thumbnail-height: 125px; - --ds-search-skeleton-thumbnail-width: 90px; - --ds-search-skeleton-thumbnail-padding: 1em; --ds-search-skeleton-thumbnail-margin: 1em; --ds-search-skeleton-text-line-count: 2; --ds-search-skeleton-badge-width: 75px;