Skip to content

Commit

Permalink
feat: add skeleton loading to onto class items (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelez committed Jun 21, 2023
1 parent 1e8f67d commit e3d7a79
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apps/dsp-app/src/app/app.module.ts
Expand Up @@ -176,6 +176,7 @@ import {
buildTagFactory,
BuildTagToken,
} from '@dasch-swiss/vre/shared/app-config';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';

// translate: AoT requires an exported function for factories
export function httpLoaderFactory(httpClient: HttpClient) {
Expand Down Expand Up @@ -344,6 +345,7 @@ export function httpLoaderFactory(httpClient: HttpClient) {
HttpClientModule,
MaterialModule,
MatJDNConvertibleCalendarDateAdapterModule,
NgxSkeletonLoaderModule,
PdfViewerModule,
ReactiveFormsModule,
TranslateModule.forRoot({
Expand Down
Expand Up @@ -5,7 +5,16 @@
[matTooltipDisabled]="resClass.label.length < MAX_LABEL_CHAR">{{trimLabel(resClass.label)}}</div>
<div class="entry-container">
<mat-icon>{{icon}}</mat-icon>
<div class="entry">{{results | i18nPlural: itemPluralMapping['entry']}}</div>
<ngx-skeleton-loader
*ngIf="results === undefined"
count="1"
appearance="line"
[theme]="{
'margin-bottom': 0,
'vertical-align': 'middle'
}">
</ngx-skeleton-loader>
<div *ngIf="results !== undefined" class="entry">{{results | i18nPlural: itemPluralMapping['entry']}}</div>
</div>
</div>
<div class="icon link" *ngIf="projectMember" [routerLink]="link + '/add'">
Expand Down
Expand Up @@ -36,6 +36,11 @@
align-items: center;
gap: 5px;

ngx-skeleton-loader {
width: 100%;
margin-right: 5%;
}

.entry {
font-size: 20px;
}
Expand Down
25 changes: 25 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -52,6 +52,7 @@
"moment": "^2.29.4",
"ng2-pdf-viewer": "^7.0.2",
"ngx-color-picker": "^12.0.1",
"ngx-skeleton-loader": "^7.0.0",
"openseadragon": "3.0.0",
"rollbar": "^2.25.0",
"rxjs": "~6.6.7",
Expand Down

0 comments on commit e3d7a79

Please sign in to comment.