-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
368014b
commit f8d5bdf
Showing
10 changed files
with
88 additions
and
32 deletions.
There are no files selected for viewing
17 changes: 14 additions & 3 deletions
17
src/module/components/mat-link-preview-container/mat-link-preview-container.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
<ng-container *ngFor="let link of linkPreviewService.links; trackBy: trackLinks"> | ||
<mat-link-preview [link]="link"></mat-link-preview> | ||
</ng-container> | ||
<ng-container *ngIf="!multiple && linkPreviewService.links.length > 0; then first else list"></ng-container> | ||
|
||
<ng-template #first> | ||
<mat-link-preview [link]="linkPreviewService?.links[0]" | ||
[showLoadingsProgress]="showLoadingsProgress"> | ||
</mat-link-preview> | ||
</ng-template> | ||
<ng-template #list> | ||
<div *ngFor="let link of linkPreviewService.links; trackBy: trackLinks"> | ||
<mat-link-preview [link]="link" | ||
[showLoadingsProgress]="showLoadingsProgress"> | ||
</mat-link-preview> | ||
</div> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 15 additions & 12 deletions
27
src/module/components/mat-link-preview/mat-link-preview.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
<div *ngIf="this.linkPreview; then render else loading"></div> | ||
|
||
<ng-template #render> | ||
<mat-card> | ||
<img mat-card-image-xs [src]="linkPreview.image"> | ||
<mat-card-title>{{linkPreview.title}}</mat-card-title> | ||
<mat-card-subtitle>{{linkPreview.description}}</mat-card-subtitle> | ||
</mat-card> | ||
</ng-template> | ||
<ng-template #loading> | ||
<mat-progress-bar *ngIf="false" mode="indeterminate"></mat-progress-bar> | ||
</ng-template> | ||
<div class="center-auto" *ngIf="!this.linkPreview && !this.loaded && this.showLoadingsProgress"> | ||
<mat-spinner></mat-spinner> | ||
</div> | ||
<mat-card> | ||
<mat-card-content> | ||
<div class="img-container"> | ||
<img mat-card-image [src]="linkPreview?.image"> | ||
</div> | ||
<div> | ||
<mat-card-title>{{linkPreview?.title}}</mat-card-title> | ||
<mat-card-subtitle>{{linkPreview?.description}}</mat-card-subtitle> | ||
<a [href]="linkPreview?.url" mat-button [color]="color">{{linkPreview?.url}}</a> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> |
28 changes: 28 additions & 0 deletions
28
src/module/components/mat-link-preview/mat-link-preview.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
:host { | ||
display: inline-block; | ||
} | ||
|
||
mat-card-content { | ||
flex-direction: row; | ||
box-sizing: border-box; | ||
display: flex; | ||
|
||
a { | ||
padding-left: 0; | ||
padding-right: 0; | ||
} | ||
} | ||
|
||
.img-container { | ||
margin-right: 1rem; | ||
place-content: center; | ||
align-items: center; | ||
flex-direction: row; | ||
box-sizing: border-box; | ||
display: flex; | ||
flex: 1 1 100%; | ||
max-width: 20%; | ||
padding: 24px 16px; | ||
} | ||
|
||
.center-auto { | ||
margin-left: auto !important; | ||
margin-right: auto !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters