forked from gothinkster/angular-realworld-example-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in feature/images-gallery (pull request gothinkster#21)
Feature/images gallery * added ng-gallery library * added shared lightbox component * added lightbox component to discogs release overview * added images to product model and api request * added lightbox to product details overview
- Loading branch information
Jaques Candeias
committed
Mar 25, 2022
1 parent
33023a4
commit e73179e
Showing
10 changed files
with
93 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
<a (click)="lightbox.open(0)" class="cursor-pointer"> | ||
<img *ngIf="!thumbSize" alt="" src="{{ imageData[0].src }}" class="{{ classes }}"> | ||
<img *ngIf="thumbSize" alt="" src="{{ imageData[0].src }}" class="{{ classes }}" [style.width.px]="thumbSize"> | ||
</a> |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { Gallery, GalleryItem, ImageItem } from 'ng-gallery'; | ||
import { Lightbox } from 'ng-gallery/lightbox'; | ||
|
||
@Component({ | ||
selector: 'app-lightbox', | ||
templateUrl: './lightbox.component.html' | ||
}) | ||
export class LightboxComponent implements OnInit { | ||
items: GalleryItem[] = []; | ||
@Input() imageData: { src: string, thumb: string}[] = []; | ||
@Input() thumbSize?: string; | ||
@Input() classes: string = ''; | ||
|
||
constructor(public gallery: Gallery, public lightbox: Lightbox) { | ||
} | ||
|
||
ngOnInit(): void { | ||
this.items = this.imageData.map(item => new ImageItem({ src: item.src, thumb: item.thumb })); | ||
const lightboxRef = this.gallery.ref('lightbox'); | ||
lightboxRef.load(this.items); | ||
} | ||
|
||
} |
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