|
16 | 16 | [src]="attachment.img_url || attachment.thumb_url || attachment.image_url" |
17 | 17 | [alt]="attachment?.fallback" |
18 | 18 | (load)="imageLoaded()" |
| 19 | + (click)="openImageModal([attachment])" |
| 20 | + (keyup.enter)="openImageModal([attachment])" |
19 | 21 | /> |
| 22 | + <div |
| 23 | + class="str-chat__gallery" |
| 24 | + data-testid="image-gallery" |
| 25 | + *ngIf="isGallery(attachment)" |
| 26 | + [class.str-chat__gallery--square]="(attachment?.images)!.length > 3" |
| 27 | + > |
| 28 | + <ng-container |
| 29 | + *ngFor=" |
| 30 | + let galleryImage of attachment.images; |
| 31 | + let index = index; |
| 32 | + let isLast = last; |
| 33 | + trackBy: trackByImageUrl |
| 34 | + " |
| 35 | + > |
| 36 | + <button |
| 37 | + *ngIf="index < 3 || (index === 3 && isLast)" |
| 38 | + class="str-chat__gallery-image" |
| 39 | + data-testclass="gallery-image" |
| 40 | + (click)="openImageModal(attachment.images!, index)" |
| 41 | + (keyup.enter)="openImageModal(attachment.images!, index)" |
| 42 | + > |
| 43 | + <img |
| 44 | + [src]=" |
| 45 | + galleryImage.img_url || |
| 46 | + galleryImage.thumb_url || |
| 47 | + galleryImage.image_url |
| 48 | + " |
| 49 | + [alt]="galleryImage.fallback" |
| 50 | + (load)="imageLoaded()" |
| 51 | + /> |
| 52 | + </button> |
| 53 | + <button |
| 54 | + *ngIf="index === 3 && !isLast" |
| 55 | + class="str-chat__gallery-placeholder" |
| 56 | + data-testclass="gallery-image" |
| 57 | + (click)="openImageModal(attachment.images!, index)" |
| 58 | + (keyup.enter)="openImageModal(attachment.images!, index)" |
| 59 | + [ngStyle]="{ |
| 60 | + 'background-image': |
| 61 | + 'url(' + |
| 62 | + (galleryImage.img_url || |
| 63 | + galleryImage.thumb_url || |
| 64 | + galleryImage.image_url) + |
| 65 | + ')' |
| 66 | + }" |
| 67 | + > |
| 68 | + <p |
| 69 | + [innerHTML]=" |
| 70 | + 'streamChat.{{ imageCount }} more' |
| 71 | + | translate: { imageCount: attachment!.images!.length - 4 } |
| 72 | + " |
| 73 | + ></p> |
| 74 | + </button> |
| 75 | + </ng-container> |
| 76 | + </div> |
20 | 77 | <div |
21 | 78 | *ngIf="isFile(attachment)" |
22 | 79 | class=" |
|
105 | 162 | </div> |
106 | 163 | </div> |
107 | 164 | </ng-container> |
| 165 | + |
| 166 | +<stream-modal |
| 167 | + *ngIf="imagesToView && imagesToView.length > 0" |
| 168 | + [isOpen]="imagesToView && imagesToView.length > 0" |
| 169 | + (isOpenChange)="$event ? null : closeImageModal()" |
| 170 | +> |
| 171 | + <div class="stream-chat-angular__image-modal"> |
| 172 | + <button |
| 173 | + class="stream-chat-angular__image-modal-stepper" |
| 174 | + [ngStyle]="{ |
| 175 | + visibility: isImageModalPrevButtonVisible ? 'visible' : 'hidden' |
| 176 | + }" |
| 177 | + data-testid="image-modal-prev" |
| 178 | + type="button" |
| 179 | + (click)="stepImages(-1)" |
| 180 | + (keyup.enter)="stepImages(-1)" |
| 181 | + > |
| 182 | + <stream-icon icon="arrow-left"></stream-icon> |
| 183 | + </button> |
| 184 | + <img |
| 185 | + class="stream-chat-angular__image-modal-image" |
| 186 | + data-testid="modal-image" |
| 187 | + [src]=" |
| 188 | + imagesToView[imagesToViewCurrentIndex].img_url || |
| 189 | + imagesToView[imagesToViewCurrentIndex].thumb_url || |
| 190 | + imagesToView[imagesToViewCurrentIndex].image_url |
| 191 | + " |
| 192 | + [alt]="imagesToView[imagesToViewCurrentIndex].fallback" |
| 193 | + /> |
| 194 | + <button |
| 195 | + class="stream-chat-angular__image-modal-stepper" |
| 196 | + type="button" |
| 197 | + [ngStyle]="{ |
| 198 | + visibility: isImageModalNextButtonVisible ? 'visible' : 'hidden' |
| 199 | + }" |
| 200 | + data-testid="image-modal-next" |
| 201 | + (click)="stepImages(1)" |
| 202 | + (keyup.enter)="stepImages(1)" |
| 203 | + > |
| 204 | + <stream-icon icon="arrow-right"></stream-icon> |
| 205 | + </button> |
| 206 | + </div> |
| 207 | +</stream-modal> |
0 commit comments