Commit 2ee36af5 authored by Marcelo Rivera's avatar Marcelo Rivera

(fix): blog tiles should open the modal. moved behaviour to the tile itself

1 merge request!507WIP: (feat): Minds Pro (development branch) - Release 3
Pipeline #78975743 failed with stages
in 7 minutes and 3 seconds
<ng-container [ngSwitch]="getType(entity)">
<img
*ngSwitchCase="'object:image'"
[src]="entity.thumbnail_src"
(click)="showMediaModal()"
#img
>
<m-video
*ngSwitchCase="'object:video'"
......@@ -18,14 +12,17 @@
[torrent]="[{ res: '360', key: entity.guid + '/360.mp4' }]"
[isActivity]="true"
(videoMetadataLoaded)="setVideoDimensions($event)"
(mediaModalRequested)="showMediaModal()"
(mediaModalRequested)="tileClicked()"
#player
></m-video>
<img
*ngSwitchCase="'object:blog'"
*ngSwitchDefault
[src]="entity.thumbnail_src"
(click)="tileClicked()"
#img
>
</ng-container>
<div class="m-proChannelTile__text" *ngIf="getTitle() || getText()">
......
import { ChangeDetectionStrategy, Component, ElementRef, Input, ViewChild } from '@angular/core';
import { ChangeDetectionStrategy, Component, ElementRef, HostListener, Input, ViewChild } from '@angular/core';
import { MediaModalComponent } from "../../../../media/modal/modal.component";
import { FeaturesService } from "../../../../../services/features.service";
import { OverlayModalService } from "../../../../../services/ux/overlay-modal";
import { Router } from "@angular/router";
import toMockActivity from "../../util/mock-activity";
import { ProChannelService } from "../../channel.service";
@Component({
selector: 'm-pro--channel-tile',
......@@ -18,6 +19,7 @@ export class ProTileComponent {
constructor(
protected featuresService: FeaturesService,
protected channelService: ProChannelService,
protected modalService: OverlayModalService,
protected router: Router,
) {
......@@ -55,6 +57,16 @@ export class ProTileComponent {
this.videoDimensions = $event.dimensions;
}
tileClicked() {
switch(this.getType(this.entity)) {
case 'object:image':
case 'object:video':
this.showMediaModal();
case 'object:blog':
this.channelService.open(this.entity, this.modalService);
}
}
showMediaModal() {
const activity = toMockActivity(this.entity);
if (this.featuresService.has('media-modal')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment